From eb3d0c57d75e19abfecb4eb4dd2b6cf7dad03873 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Thu, 19 Jan 2012 21:28:00 +0100 Subject: [PATCH] DOC: Added migration documentation for dispatchers. See #1406 --- .../project/migration-guide-1.3.x-2.0.x.rst | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/akka-docs/project/migration-guide-1.3.x-2.0.x.rst b/akka-docs/project/migration-guide-1.3.x-2.0.x.rst index 07dea5974f..219136ac95 100644 --- a/akka-docs/project/migration-guide-1.3.x-2.0.x.rst +++ b/akka-docs/project/migration-guide-1.3.x-2.0.x.rst @@ -437,6 +437,47 @@ Documentation: * :ref:`actors-scala` * :ref:`untyped-actors-java` +Dispatchers +----------- + +Dispatchers are defined in configuration instead of in code. + +v1.3:: + + // in code + val myDispatcher = Dispatchers.newExecutorBasedEventDrivenDispatcher(name) + .withNewThreadPoolWithLinkedBlockingQueueWithCapacity(100) + .setCorePoolSize(16) + .setMaxPoolSize(128) + .setKeepAliveTimeInMillis(60000) + .build + +v2.0:: + + // in config + my-dispatcher { + type = Dispatcher + core-pool-size-factor = 8.0 + max-pool-size-factor = 16.0 + mailbox-capacity = 100 + } + +The dispatcher is assigned to the actor in a different way. + +v1.3:: + + actorRef.dispatcher = MyGlobals.myDispatcher + slef.dispatcher = = MyGlobals.myDispatcher + +v2.0:: + + val myActor = system.actorOf(Props[MyActor].withDispatcher("my-dispatcher"), "myactor") + +Documentation: + + * :ref:`dispatchers-java` + * :ref:`dispatchers-scala` + Spawn ----- @@ -469,7 +510,6 @@ More to be written ------------------ * Futures -* Dispatchers * STM * TypedActors * Routing