akka/akka — pull request #469 by sirthias (2012-05-22 09:10:53+00:00)
Title: Make method `dispatcher` in ActorRefFactory trait public (was protected)

`ActorRefFactory` is only extended by `ActorSystem` and `ActorContext`, both of which make `dispatcher` public anyway. Writing code that requires access to the dispatcher (e.g. for Promise creation) and is supposed to work with ActorSystems as well as ActorContexts is easier if the ActorRefFactory allows public access to the dispatcher directly.

Otherwise one has to resort to ugly constructs such as this:

val promise = Promise[T]() {
refFactory match {
case x: ActorContext => x.dispatcher
case x: ActorSystem => x.dispatcher
case x => throw new IllegalArgumentException("Unsupported ActorRefFactory '" + x + "'")
}
}