Ultimately I was able to find a group of related directives.

So this for example works:

...

public Route route() {
 return parameterOptional("name", optName -> {
  String name = optName.orElse(_defaultName);
  return parameterOptional("times", optTimes -> {
   int times = optTimes.map(Integer::parseInt).orElse(1);
   final Marshaller<Saying, RequestEntity> marshaller = 
Jackson.<Saying>marshaller();
   return completeOKWithFuture(futureSayHello(name, times), marshaller);
  });
 });
}

//convert the Observable to a completeionStage
public CompletionStage<Saying> futureSayHello(final String name, final int 
times) {
...






On Monday, September 5, 2016 at 5:28:19 PM UTC+3, Adam wrote:
>
> Hi,
>
> I'm looking at the docs trying to find an example of how to create a route 
> that does not complete the result synchronously from the route tree, but 
> rather relies on some other asynchronous chain of events.
> All I can find is this page: 
> http://doc.akka.io/docs/akka/2.4/java/http/routing-dsl/routes.html
>
> That's not really enough to get started easily...
> Actually I think some of the methods mentioned there don't really exist.
> For example: Route::asyncHandler.
>
> Am I missing something here?
> Does a simple example exist and I simply can't find it?
> The activator code for Akka HTTP micro-service also seems to be out of 
> date, so I cannot use that either.
> I actually have some preexisting (POC grade) code that relied on 2.4.4 
> (unfortunately it was also hard to find what to do the first time around) 
> and I'm now converting it to 2.4.9 and yet it's still quite hard to easily 
> find what to do.
>
> Adam.
>

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to