Hi,

I thought your original question was about getting hold of the ActorRef of your 
ActorProducer so you could communicate with it, and the way to get the 
materialized value of both the Source and the Sink is to use runWith on the 
Flow, and pass in the Source and the Sink.

Here is some pseudocode

val (actorRef, whatever) = flow.runWith(actorProducerSource, whateverSink)
actorRef ! Cancel

B/

On 3 March 2015 at 14:59:07, Jelmer Kuperus (jkupe...@gmail.com) wrote:

Hi Björn,

I am not sure if i understand you. 

The piece of software i am created listens to messages posted to topics, when a 
message arrives we perform some operation (call an external system). 
The flow of messages will never stop. New ones will keep coming in. But we 
still want to bring down a node. 

When we do we want to first stop the producer from reading messages of a topic 
and then wait until there are no messages left in flight so we can safely 
shutdown



Op dinsdag 3 maart 2015 12:12:06 UTC+1 schreef Björn Antonsson:
Hi,

If you're on 1.0-M4, have you looked at runWith on Flow that takes both a 
Source and a Sink and give you a Tuple of the materialized values?

B/

On 1 March 2015 at 23:23:58, Jelmer Kuperus (jkup...@gmail.com) wrote:

Suppose you have a akka stream backed by an ActorPublisher that listens to a 
continuous stream of data from a messaging system
Then how do you cancel this stream ?

When you create the source you pass in the props so you don't have access to 
the actorref. So you can say, send it a Cancel message

Constructing the stream will give you a future and not a Cancellable

I am looking for a way to gracefully shut down without losing any messages
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
--
Björn Antonsson
Typesafe Inc. – Reactive Apps on the JVM
twitter: bantonsson

JOIN US. REGISTER TODAY!
Scala
Days
March 16th-18th,
San Francisco
--
>>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
--
Björn Antonsson
Typesafe Inc. – Reactive Apps on the JVM
twitter: bantonsson

JOIN US. REGISTER TODAY!
Scala
Days
March 16th-18th,
San Francisco

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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