Hi Björn,
Thanks for your reply.
Let me see if I understand correctly. If I have an actor with a counter,
then this code would be problematic:
class MyActor extends PersistentActor {
var counter = 0
override def receiveCommand: Receive = {
case Increment =
counter += 1 //
Hi,
Is there a specific way to shutdown a router v.s. a regular Actor?
Is there any idiom for shutting down a router along with its routees?
Thanks,
Matan
--
Read the docs: http://akka.io/docs/
Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
Search
Ok so i played around with it a bit and i get that i can do something like
this
val actor: ActorRef = Source[Int](Props()).to(Sink.ignore()).run()
but as soon as you add grouping to the mix this falls apart. Eg :
Source[Int](Props()).groupBy(_ % 2).runForeach(_ = ()) will return a
Hi Jelmer,
instead of the runForeach method you can use the following (which basically
does the two steps separately that are packaged in the runForeach convenience):
val ref = Source[Int](Props()).groupBy(_ % 2).to(Sink.foreach(_ = ()).run()
Regards,
Roland
8 mar 2015 kl. 13:21 skrev