I forgot that the documentation said something about this (remembering it 
like five seconds after asking the question) . I went to look it up and I 
found this:

Stream transformations and side effects involving external non-stream based 
services can be performed withmapAsync or mapAsyncUnordered.

I need to represent the blocking service as a future and use mapAsync with 
a custom dispatcher then. 

Since I have a stateful actor that produces items one after the other as 
soon as they're requested (my current ActorProducer), I guess I need to 
model it as a normal actor so that I can ask it "giveMeNextItem" and use 
the resulting future in a mapAsync. Is that correct?


Sorry for thinking out loud but the model is pretty different from rx 
schedulers and I'm trying to "grok" it as well as I can :)

Cheers 
G


On Wednesday, 18 February 2015 23:54:07 UTC, Giovanni Alberto Caporaletti 
wrote:
>
> Hi again,
> I have another question.
> Let's say that I write a blocking ActorProducer (could be anything, 
> external service, database, whatever), and I want it to use a specific 
> dispatcher explicitly configured to handle blocking operations. Suppose I 
> have an MyActor.props() method that returns something like 
> Props[MyActor].withDispatcher("my-dispatcher").
>
> Now, when I create a source with Source(MyActor.props) and materialize it 
> in a flow, every actor involved in the flow uses the dispatcher configured 
> in the ActorFlowMaterializerSettings (or the default dispatcher if nothing 
> is configured). In other words, the .withDispatcher("...") in the props is 
> completely ignored.
>
> How do I configure an ActorProducer to be on a differentdispatcher? If 
> this is the wrong way of doing it, how should I handle blocking 
> ActorProducers?
>
> Thank you
>
> G
>

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

Reply via email to