Last minute awesomization of the priority based mailbox API docs

This commit is contained in:
Viktor Klang 2012-02-21 18:24:38 +01:00
parent 2b4c8b2508
commit 98b74a974c
2 changed files with 21 additions and 31 deletions

View file

@ -112,15 +112,14 @@ object DispatcherDocSpec {
import akka.actor.ActorContext
import com.typesafe.config.Config
val generator = PriorityGenerator { // Create a new PriorityGenerator, lower prio means more important
case 'highpriority 0 // 'highpriority messages should be treated first if possible
case 'lowpriority 100 // 'lowpriority messages should be treated last if possible
case PoisonPill 1000 // PoisonPill when no other left
case otherwise 50 // We default to 50
}
// We create a new Priority dispatcher and seed it with the priority generator
class PrioMailbox(config: Config) extends UnboundedPriorityMailbox(generator)
class PrioMailbox(config: Config) extends UnboundedPriorityMailbox(
PriorityGenerator { // Create a new PriorityGenerator, lower prio means more important
case 'highpriority 0 // 'highpriority messages should be treated first if possible
case 'lowpriority 100 // 'lowpriority messages should be treated last if possible
case PoisonPill 1000 // PoisonPill when no other left
case otherwise 50 // We default to 50
})
//#prio-mailbox
class MyActor extends Actor {