You are trying to create route at one place (reject part) and directive in another (provide).
Directives can pass and reject stuff eventually they will produce a Route. Maybe this is more or less you want to achive? Notice the predicate part added. This will be a simple function composition now. https://gist.github.com/almendar/416f3bd0f8ef30505166 As for using directives to reject stuff: in source you can find sth like this: private val _rejectEmptyResponse: Directive0 = mapRouteResult { case Complete(response) if response.entity.isKnownEmpty ⇒ Rejected(Nil) case x ⇒ x } this basically shows how to change already created routest. W dniu wtorek, 25 sierpnia 2015 09:23:54 UTC+3 użytkownik [email protected] napisał: > > 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
