These are chat archives for petabridge/akka-bootcamp

16th
Jun 2015
Igor Ziselman
@constructor-igor
Jun 16 2015 13:49
I don't understand general policy how low level actor returns/forwards result to other actor. For example, I have 4 post-processing actors and each actor should work after previous actor. Right now (without actors) "manager" class calls "post-processing" classes one by one. Each post-processing class makes job and return result (to manager) and has not any references to other "post-processing" classes. Now, each actor should "send" result to next actor? or return to manager for forwarding or receive in message address of next actor? Please, could you suggest me "best known methods" or working experience?
Bartosz Sypytkowski
@Horusiath
Jun 16 2015 14:07
@constructor-igor Details of the pipelining depend on your scenario:
  • In general use use "manager" as a mediator between "post-processing" if there are some mid-steps involved, which are out of scope of the particular actor. This is not performance wise however.
  • You can build flow directly inside the message, setting inside a list of receipient's, current message should reach. Each actor-step could pick itself from that list and send message forward to the next step. This applies in cases when flow shape changes based on user input or when "manager" who's setting the recipients list is able to perform optimization on actor's load balancing.
  • You could bind your actors together by passing IActorRef of next actor-step to each actor, creating a flow this way. Think of it as a linked list of actors. You need only to know, where the head is - each actor can process a message and forward a new-message with original sender to next actor. The last one can send message back to the sender. Problem here is that in most cases work performed by your actor's is not equally time-consuming - hence you'll need some buffering/backpressure mechanism for that (at least untill Akka.Streams will came out). Variations of this are the most common practices when dealing with logic flows.
Igor Ziselman
@constructor-igor
Jun 16 2015 15:29
I implement test now and run actors from tests (VS2013+R#, nunit) and code in actor fails on line Directory.CreateDirectory(start.DataFolder.Folder);" without error's message. Could you help me to understand how to investigate the issue? Code works in "normal" implementation.
Bartosz Sypytkowski
@Horusiath
Jun 16 2015 17:43
How does it fails without error msg? Also, remember that everything is async here, maybe you're trying to create directory in path that's no longer valid (i.e. it has been created/deleted already).