Updates after feedback
This commit is contained in:
parent
83b08b20d9
commit
5fd40e53ca
9 changed files with 33 additions and 71 deletions
|
|
@ -11,16 +11,11 @@ import akka.actor.Props;
|
|||
|
||||
//#imports
|
||||
|
||||
//#imports2
|
||||
import akka.actor.mailbox.DurableMailboxType;
|
||||
//#imports2
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import akka.testkit.AkkaSpec;
|
||||
import akka.docs.dispatcher.DispatcherDocSpec;
|
||||
import com.typesafe.config.ConfigFactory;
|
||||
import akka.actor.ActorRef;
|
||||
import akka.actor.ActorSystem;
|
||||
|
|
@ -55,22 +50,9 @@ public class DurableMailboxDocTestBase {
|
|||
myActor.tell("test");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void programaticallyDefinedDispatcher() {
|
||||
//#prog-define-dispatcher
|
||||
MessageDispatcher dispatcher = system.dispatcherFactory()
|
||||
.newDispatcher("my-dispatcher", 1, DurableMailboxType.fileDurableMailboxType()).build();
|
||||
ActorRef myActor = system.actorOf(new Props().withDispatcher(dispatcher).withCreator(new UntypedActorFactory() {
|
||||
public UntypedActor create() {
|
||||
return new MyUntypedActor();
|
||||
}
|
||||
}), "myactor");
|
||||
//#prog-define-dispatcher
|
||||
myActor.tell("test");
|
||||
}
|
||||
|
||||
public static class MyUntypedActor extends UntypedActor {
|
||||
public void onReceive(Object message) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue