There’s a Java 8 ask implementation in PatternsCS that will give you a CompletionStage instead of a Future.
May I ask why you prefer the vastly more verbose anonymous class syntax instead of a lambda? Regards, Roland > 15 apr 2016 kl. 03:06 skrev Federico Jakimowicz <[email protected]>: > > Hi, > > I'm definitely having a bad time with akka http. > If I want that an actor do something and then use that result in the response > of an httpRequest. How would be the right way to do so? > I thought that using Patterns.ask in this way > > > Future<RouteResult> handler = Patterns.ask(greeterActor, "Hello", 1000) > > .map(new Mapper<Object, RouteResult>(){ > > public RouteResult apply(String o) { > > return ctx.complete(o.toString()); > > } > > }, ctx.executionContext()); > > and then passing ctx.completeWith(handler) however completeWith receives a > CompletionStage<RouteResult> so that wont work and I'm stuck. > How could i get a CompletionStage out of that? > > thanks you > > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/> > >>>>>>>>>> Check the FAQ: > >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html> > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > >>>>>>>>>> <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] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/akka-user > <https://groups.google.com/group/akka-user>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
