Hi,

use the combinators of the Directive class to make custom directives. E.g.

extractClientIp.flatMap { ip =>
  val cond = // something
  if (cond) pass else reject(...)
}

or if you want to return a value, i.e. create a Directive1[T], use 
`provide` instead of `pass`.

HTH
Johannes

On Tuesday, August 25, 2015 at 8:23:54 AM UTC+2, tdroz...@gmail.com wrote:
>
> I'm new to working with akka-http and have a question that I hope someone 
> can provide some guidance with.
>
> I've been trying to build my own custom directive - that would take the 
> results of an existing directive - perform some logic and then move onto 
> the next directive, or reject route. 
>
> For example...
>
> Let's say I want to take the extractClientIp directive, use the 
> RemoteAddress value to perform some logic and either continue on with 
> further directives or reject the request.  I don't intend to complete the 
> request here.
>
> Is this possible?  To make this re-usable is a directive what I'd want to 
> do here?  Or am I over thinking this?
>
> Any help is appreciated!
>
> -t
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to