Introduce stable priority mailboxes.

Similar to existing priority mailboxes, but these preserve FIFO ordering
for messages of equal priority.
This commit is contained in:
dch 2015-01-10 14:44:25 +00:00
parent c56d670c03
commit 8df81e6b72
8 changed files with 289 additions and 13 deletions

View file

@ -187,13 +187,13 @@ object DispatcherDocSpec {
//#prio-mailbox
import akka.dispatch.PriorityGenerator
import akka.dispatch.UnboundedPriorityMailbox
import akka.dispatch.UnboundedStablePriorityMailbox
import com.typesafe.config.Config
// We inherit, in this case, from UnboundedPriorityMailbox
// We inherit, in this case, from UnboundedStablePriorityMailbox
// and seed it with the priority generator
class MyPrioMailbox(settings: ActorSystem.Settings, config: Config)
extends UnboundedPriorityMailbox(
extends UnboundedStablePriorityMailbox(
// Create a new PriorityGenerator, lower prio means more important
PriorityGenerator {
// 'highpriority messages should be treated first if possible