Hi Jelmer,

Take a look at this section in the docs:
http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-M4/scala/stream-flows-and-basics.html#Combining_materialized_values

It demonstrates various ways to combine and access the materialized values.

-Endre

On Tue, Mar 3, 2015 at 3:18 PM, Jelmer Kuperus <[email protected]> wrote:

> Ah I missed that! that should work for me i think. Thanks
>
> Op dinsdag 3 maart 2015 15:05:59 UTC+1 schreef Björn Antonsson:
>>
>> 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 ([email protected]) 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 ([email protected]) 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 [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.
>>>
>>>   --
>>> Björn Antonsson
>>>  Typesafe Inc. <http://typesafe.com> – Reactive Apps on the JVM
>>> twitter: bantonsson <http://twitter.com/bantonsson>
>>>
>>>  JOIN US. REGISTER TODAY!
>>> <http://event.scaladays.org/scaladays-sanfran-2015>
>>>  Scala <http://event.scaladays.org/scaladays-sanfran-2015>
>>>  Days <http://event.scaladays.org/scaladays-sanfran-2015>
>>>   March 16th-18th, <http://event.scaladays.org/scaladays-sanfran-2015>
>>>  San Francisco <http://event.scaladays.org/scaladays-sanfran-2015>
>>>
>>  --
>> >>>>>>>>>> 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.
>>
>> --
>> Björn Antonsson
>> Typesafe Inc. <http://typesafe.com> – Reactive Apps on the JVM
>> twitter: bantonsson <http://twitter.com/bantonsson>
>>
>> JOIN US. REGISTER TODAY!
>> <http://event.scaladays.org/scaladays-sanfran-2015>
>> Scala <http://event.scaladays.org/scaladays-sanfran-2015>
>> Days <http://event.scaladays.org/scaladays-sanfran-2015>
>> March 16th-18th, <http://event.scaladays.org/scaladays-sanfran-2015>
>> San Francisco <http://event.scaladays.org/scaladays-sanfran-2015>
>>
>  --
> >>>>>>>>>> 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.
>

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