Git Product home page Git Product logo

akka-patterns's Introduction

Work Pulling Pattern

Pattern to prevent mailbox overflow, throttle and distribute work.

Benefits

  1. No more out of memory issues because of too many messages in the mailboxes.
  2. We only create as much work as is actually needed - Kanban style! This also means minimal liability for the workers. If a node goes down, we only loose the messages that were currently worked on.
  3. Completely non-blocking, fully utilise your resources.
  4. The actors involved can still receive other messages, e.g. to stop them.
  5. Distribute work across the cluster with ease. Fully utilize all your boxes so you don't need more than necessary.
  6. Scale up and down dynamically by simply adding more nodes to the cluster during the execution of an epic. The workers on that node will happily join in with the other workers and start kicking off work to speed up the execution. Afterwards you can shut it down again to save some pesos. Cloud computing at it's best!
  7. It's not a polling model where you have the overhead that workers regularly ask for work. They only ask when there's actually work available.
  8. Easy to use: simply instantiate a master, give it a name and implement doWork on the worker.

Getting started

All it takes is to instantiate a master node, create an epic and workers that implement doWork. See WorkPullingPatternEmailScenarioSpec for a working example.

More details

For a full description check out my blog post Feel free to clone / fork / steal / pull-request / whatever it ;)

akka-patterns's People

Contributors

bbozo avatar mpollmeier avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.