clarify need to carefully managing blocking, see #2616

This commit is contained in:
Roland 2012-10-15 21:34:31 +02:00
parent ef80428b02
commit c27389ca1b
7 changed files with 86 additions and 10 deletions

View file

@ -186,6 +186,13 @@ class DispatcherDocSpec extends AkkaSpec(DispatcherDocSpec.config) {
//#defining-pinned-dispatcher
}
"looking up a dispatcher" in {
//#lookup
// for use with Futures, Scheduler, etc.
implicit val executionContext = system.dispatchers.lookup("my-dispatcher")
//#lookup
}
"defining priority dispatcher" in {
//#prio-dispatcher

View file

@ -13,6 +13,15 @@ Default dispatcher
Every ``ActorSystem`` will have a default dispatcher that will be used in case nothing else is configured for an ``Actor``.
The default dispatcher can be configured, and is by default a ``Dispatcher`` with a "fork-join-executor", which gives excellent performance in most cases.
.. _dispatcher-lookup-scala:
Looking up a Dispatcher
-----------------------
Dispatchers implement the :class:`ExecutionContext` interface and can thus be used to run :class:`Future` invocations etc.
.. includecode:: code/docs/dispatcher/DispatcherDocSpec.scala#lookup
Setting the dispatcher for an Actor
-----------------------------------