Monday 6 April 2015

Routers and Dispatchers in Akka

Routers
The basic purpose of a router is to provide a means to determine where messages are sent between a group of possible actors. In fact, one of the most common use cases for routers in Akka is to balance some load across a set of actors.

Dispatchers
Dispatchers as embodying two fundamental concepts: management of the actor mailbox and the threading strategy used to allow actors to do actual work.

1. You have the choice of whether to assign a distinct mailbox for each actor or to share one for all. Further, you can choose whether the mailboxes should be of unlimited capacity or if they should be bounded to some fixed limit. The default dispatcher gives each actor its own unbounded mailbox. 

2. The task management piece is to abstract out how threads are managed and how actors are given time and resources in the form of these threads in which to perform their tasks.

No comments:

Post a Comment