Introduce stable priority mailboxes.
Similar to existing priority mailboxes, but these preserve FIFO ordering for messages of equal priority.
This commit is contained in:
parent
c56d670c03
commit
8df81e6b72
8 changed files with 289 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue