Prevent throwables thrown in futures from disrupting the rest of the system. Fixes #710

This commit is contained in:
Derek Williams 2011-03-20 17:15:23 -06:00
parent 29e7328bdb
commit 32be3162bf
3 changed files with 31 additions and 2 deletions

View file

@ -35,7 +35,7 @@ final case class FutureInvocation(future: CompletableFuture[Any], function: () =
def run = future complete (try {
Right(function.apply)
} catch {
case e: Exception =>
case e =>
EventHandler.error(e, this, e.getMessage)
Left(e)
})
@ -203,6 +203,11 @@ trait MessageDispatcher {
* Returns the size of the mailbox for the specified actor
*/
def mailboxSize(actorRef: ActorRef): Int
/**
* Returns the size of the Future queue
*/
def futureQueueSize: Int = futures.size
}
/**