[akka-user] Re: Futures and Supervision

2014-12-09 Thread David
Thank you! On Tuesday, December 9, 2014 2:11:53 PM UTC-5, David wrote: > > Question in a nutshell: > My Akka Actor creates a Future using the macro Future{someBlockingCall} > within it's receive method. > Inside someBlockingCall, I throw an exception. This does not trigger a > supervisor in the

Re: [akka-user] Re: Futures and Supervision

2014-12-09 Thread √iktor Ҡlang
On Tue, Dec 9, 2014 at 9:43 PM, David wrote: > I am confused because i thought that f is a future. > > val f = (mybatchReader ? Read( "something" ) ).mapTo[Option[String]] > f.onComplete{ > case SUCCESS => > println( "Got x" ) > > > But I am returning a non-future > val x:String = som

Re: [akka-user] Re: Futures and Supervision

2014-12-09 Thread David
I am confused because i thought that f is a future. val f = (mybatchReader ? Read( "something" ) ).mapTo[Option[String]] f.onComplete{ case SUCCESS => println( "Got x" ) But I am returning a non-future val x:String = someFunctionThatThrowsAnException() orig_sender ! x Or i

Re: [akka-user] Re: Futures and Supervision

2014-12-09 Thread √iktor Ҡlang
Could you elaborate on the question, I'm not sure I understand what you mean? On Tue, Dec 9, 2014 at 9:21 PM, David wrote: > Thanks Victor, Ryan for helping to clear up some fundamental understanding > of mine. > > Can you please tell me why this works? > > This ditches the Future. > > The Drive

[akka-user] Re: Futures and Supervision

2014-12-09 Thread David
Thanks Victor, Ryan for helping to clear up some fundamental understanding of mine. Can you please tell me why this works? This ditches the Future. The Driver does an Ask to MyBatchReader, which expects a future but MyBatchReader returns a non-Future. class MyDriver extends Actor{ implic

[akka-user] Re: Futures and Supervision

2014-12-09 Thread Ryan Tanner
As you can see, futures have their own form of error handling. The behavior you're seeing is exactly what's supposed to happen. Futures can be used completely independently of actors so if you want failed futures to trigger Akka's supervision, you'll need to do so yourself. In this case, if