Hi Gary,

it's as simple as setting a dispatcher for a Flow.


val flow = 
Flow[String].via(myBlockingStage).withAttributes(ActorAttributes.dispatcher(“my-configured-blocking-dispatcher”))

(setting a dispatcher also implies an asynchronous boundary).

Of course try to avoid these blocking APIs, you could for example setup a timer 
(GraphStage has support for that) which checks the future regularly for 
completion and pushes once it's finally completed.

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Lightbend

On 24 February 2016 at 02:50:54, Gary Struthers ([email protected]) wrote:

I'm calling a 3rd party Java library that returns a Java Future from my 
GraphStageLogic onPush(). I want the future to complete before calling 
pull(in). Simply blocking with Java Future's get(...) works. So do I really 
need to do this within a blocking-dispatcher? If so, how do I setup onPush() to 
use the dispatcher?

Thanks,
Gary
--
>>>>>>>>>> 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.

-- 
>>>>>>>>>>      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.

Reply via email to