Note that there are some explanatory texts on larger screens.

plurals
  1. POAkka (1-node prod/cons): BalancingDispatcher being deprecated soon. What takes it's place?
    primarykey
    data
    text
    <p>According to <a href="http://www.amazon.co.uk/Effective-Akka-Jamie-Allen/dp/1449360076/ref=sr_1_1?ie=UTF8&amp;qid=1386415076&amp;sr=8-1&amp;keywords=effective%20akka" rel="nofollow noreferrer">"Effective Akka"</a> balancing dispatcher is being deprecated soon. I'm gonna start working on some (single machine) producer/consumer code that deals with processing workload of drastically different shapes. What should I use ? </p> <p>I'd like the producer to block (akka block or thread block, I care not) (<a href="https://stackoverflow.com/questions/12694167/do-i-need-to-take-care-of-producer-consumer-rate-matching-when-using-akka-1-3s">similar to this question</a>) since it'll be piping in 204,000 entries from a database cursor :D</p> <p>Writing the <a href="http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2" rel="nofollow noreferrer">boiler plate</a> for my own pattern seems way too heavy handed. There has to be something new in the pipeline replacing the balancing dispatcher.</p> <hr> <p><em>Disorganised</em> notes to self / train of thought.</p> <p><strong>What I am trying to solve:</strong> </p> <p>Write with as <strong>little code</strong> as possible a producer-consumer system with 2 actor classes that saturates the processing power of a single machine. Also, do not dispatch all work from the consumer in one go as a) there is a lot of work (I don't know what the size limits of child mailboxes are) and b) the work has different shapes.</p> <p><strong>Approaches / Assumptions</strong></p> <p><strike> I have not seen an example with a balanced dispatcher, so my expectations of what it does or how it can be used are most likely warped. A dispatcher seems very much a concept that is tied to the entire actor system, and documentation indicates requiring that all actors of a balanced dispatcher based actor system should be able to handle the same messages (or perhaps in other words be the same actor type). </p> <p>If this is indeed the case the assumption doesn't really map neatly to prod-cons as the cons driver would have to be outside of the actor system. as either an actor in another system or a future based ask loop in the app startup. The actor types in balancing dispatcher could always have the logic and message types to become a prod but this would be a rather nasty hack. Or perhaps the actor system startup has a hook that can be used to pipe the message queue full (but again that doesn't seem like a nice way to do things). I'm coming to the conclusion that the balanced dispatcher is indeed nasty. </strike></p> <p>The above assumption is wrong, the end of the router documentation has this to say:</p> <blockquote> <p>At first glance there seems to be an overlap between the BalancingDispatcher and Routers, but they complement each other. The balancing dispatcher is in charge of running the actors while the routers are in charge of deciding which message goes where. A router can also have children that span multiple actor systems, even remote ones, but a dispatcher lives inside a single actor system.</p> </blockquote> <p>Which kind of solidifies the case for my question :D </p> <p>Ok so child actors specified with a balancing dispatcher + a round robin router might do the trick. But where is the size of the shared mailbox attached (from general overview below, the optional parameters <code>mailboxcapacity</code> and <code>mailbox-type</code> seem to do it). </p> <p><strong>Links</strong> </p> <p>There are three concepts in play here. <a href="http://doc.akka.io/docs/akka/2.2.3/scala/dispatchers.html" rel="nofollow noreferrer">The dispatcher</a>, <a href="http://doc.akka.io/docs/akka/2.2.3/scala/routing.html" rel="nofollow noreferrer">The router</a> and the <a href="http://doc.akka.io/docs/akka/2.2.3/scala/mailboxes.html" rel="nofollow noreferrer">mailbox</a>. </p> <p><a href="http://www.packtpub.com/article/dispatchers-routers" rel="nofollow noreferrer">General overview</a></p> <p>The latest documentation linked above does not seem to mention the balancing dispatcher being deprecated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload