[akka-user] Re: How to get the number of source actors with akka stream?

2017-03-12 Thread Rafał Krzewski
Hi Leo, your disconnect() method was invoked at the time stream definition was constructed, and connected() method was invoked the previously constructed stream definition was materialized into a live stream instance. The second argument of Sink.actorRef is the message object that will be sent

[akka-user] Re: How to get the number of source actors with akka stream?

2017-03-08 Thread Leo Wolf
Hi Rafał, I have a source as val userSource = Source.actorRef(10, OverflowStrategy. fail).mapMaterializedValue(connected())), and a sink as val userSink = Sink. actorRef[NotifyEnvelope](usrActor, disconnect()) And I printed the log in the connected() and the disconnect(), but found out when the

[akka-user] Re: How to get the number of source actors with akka stream?

2017-03-05 Thread Rafał Krzewski
Hi Leo, The actor is created each time you materialize a new instance of your stream, which is something your application code does explicitly. Materializing the stream yields and ActorRef that you can send to a dedicated tracking actor. Each time it receives and ActorRef, it increments an inte