Re: [akka-user] Bridging spray router and service actors

2014-10-01 Thread Richard Rodseth
This looks interesting. Future.collect. Learn something new every day. http://www.superloopy.io/articles/2013/spray-routing-error-handling.html On Wed, Oct 1, 2014 at 11:00 AM, Richard Rodseth wrote: > Thanks for clarifying. I was using the version of complete I showed in > order to have control

Re: [akka-user] Bridging spray router and service actors

2014-10-01 Thread Richard Rodseth
Thanks for clarifying. I was using the version of complete I showed in order to have control over the status code etc, but there are no doubt other ways to do that in Spray. My takeaway is that I shouldn't be too hasty about standardizing on per-request actors. On Wed, Oct 1, 2014 at 2:13 AM, Akk

Re: [akka-user] Bridging spray router and service actors

2014-10-01 Thread Akka Team
Hi Richard, No, I mean the other complete() method that you call from the Success and Failure paths of the onComplete block. Why not just use complete(result.transform(...))? -Endre On Wed, Oct 1, 2014 at 2:01 AM, Richard Rodseth wrote: > Hi Endre > > Yes, the one I showed (onComplete()) *is*

Re: [akka-user] Bridging spray router and service actors

2014-09-30 Thread Richard Rodseth
Hi Endre Yes, the one I showed (onComplete()) *is* taking a future. The result of my ask is a Future[Long]. On Tue, Sep 30, 2014 at 3:58 AM, Akka Team wrote: > Hi Richard, > > > >> The route looks something like this: >> >> post { >> >> val result = (xyzService ? >> XYZService.Creat

Re: [akka-user] Bridging spray router and service actors

2014-09-30 Thread Akka Team
Hi Richard, > The route looks something like this: > > post { > > val result = (xyzService ? > XYZService.CreateXYZ(xyzAttributes)).mapTo[Long] > > onComplete(result) { > > case Success(value) => complete(s"The result was $value") > > case Failure(ex) => complete(

[akka-user] Bridging spray router and service actors

2014-09-27 Thread Richard Rodseth
Suppose I have an actor hierarchy like this: SprayAPIRoutingActor XYZServiceActor ..DbActor ..OtherActor1 ..OtherActor2 The DbActor wraps one or more blocking DAOs and has its own dispatcher to isolate the blocking. The router actor has access to the root service actor. I have implemented one ro