[akka-user] Re: [akka-http] java completeWith mapping future

2016-02-15 Thread 'Erik Frister' via Akka User List
Thanks Benoit for posting the explicit solution, that saved my some headaches! For anyone having similar issues like me: be aware that you need to import the scala Future for the return type of the "handleGetTask" method, not the Java future! Otherwise you'll get compilation errors regarding

Re: [akka-user] Re: [akka-http] java completeWith mapping future

2015-11-17 Thread Patrik Nordwall
The Scala Future API is rather clunky for Java when you get used to Java8 lambas. You can try the scala-java8-compat library and work with CompletionStage instead. Cheers, Patrik On Thu, Nov 12, 2015 at 12:00 PM, Benoit Guillon

[akka-user] Re: [akka-http] java completeWith mapping future

2015-11-12 Thread Benoit Guillon
Hi André, Thanks for your reply, using Mapper works fine (a bit more verbose than the scala implementation) For those who have the same issue: here is the solution: private Future handleGetTask(RequestContext ctx){ return Patterns.ask(actorSystem.actorFor("myActor"), buildMessage(), 1000)

[akka-user] Re: [akka-http] java completeWith mapping future

2015-11-11 Thread André
Hi Benoit, you should take a look at http://doc.akka.io/docs/akka/snapshot/java/futures.html#Future_is_a_Monad. Mapper should solve your Problem. Cheers André On Wednesday, November 11, 2015 at 12:01:05 PM UTC+1, Benoit Guillon wrote: > > Hi, > > I'm using akka http with Java DSL and I'm