I think you would be pleased using Scala, and at first just treating it as
a better Java until you are more comfortable with it. To demonstrate the
code enconomy you will get, consider this:
import scala.util.{Success, Failure}
(actor ? message).onComplete {
case Success(goodMessage) => Ok("Something good.")
case Failure(fail) => InternalServerError("Request failed.")
}
What do you think compared to the Java example?
Vaughn
On Sunday, December 6, 2015 at 9:58:41 AM UTC-7, ash.ta wrote:
>
> hi all,
>
> i just started to play around with akka, coming with a background in
> node.js and other reactive/async stuff.
> so, i'm sorry in advance if this newbie questions sounds totally stupid.
>
> i'm trying to make things happen in java due to the lack of knowledge of
> scala (should i waste my time on this at all?)
> i'm failing to produce a simple example of the following flow (btw, since
> spray seems to provide only scala api (am i wrong?) i moved to latest
> akka-http):
> http request arrives -> an actor is triggered -> some logic is done within
> the actor -> actor returns the result back to http server -> response is
> sent back.
>
> my basic problem is that i can't find a way to bind
>
> Future<Object> returned from Patterns.ask() to RequestContext.complete().
>
>
> can anyone help me with an advise or point me to the existing example?
>
>
> thanks!
>
>
--
>>>>>>>>>> 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.