DOC: Update Durable Mailboxes Chapter. See #1472

This commit is contained in:
Patrik Nordwall 2011-12-12 08:37:18 +01:00
parent 08af7684e5
commit eaafed69eb
9 changed files with 316 additions and 280 deletions

View file

@ -0,0 +1,31 @@
package akka.docs.actor.mailbox
//#imports
import akka.actor.Actor
import akka.actor.Props
import akka.actor.mailbox.FileDurableMailboxType
//#imports
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
import org.scalatest.matchers.MustMatchers
import akka.testkit.AkkaSpec
class MyActor extends Actor {
def receive = {
case x
}
}
class DurableMailboxDocSpec extends AkkaSpec {
"define dispatcher with durable mailbox" in {
//#define-dispatcher
val dispatcher = system.dispatcherFactory.newDispatcher(
"my-dispatcher", throughput = 1, mailboxType = FileDurableMailboxType).build
val myActor = system.actorOf(Props[MyActor].withDispatcher(dispatcher), name = "myactor")
//#define-dispatcher
myActor ! "hello"
}
}