Fixing pointless error on ask timeout completion

This commit is contained in:
Viktor Klang 2012-02-21 12:14:13 +01:00
parent 445ffa3a7d
commit 8248379f92

View file

@ -191,7 +191,7 @@ trait AskSupport {
val result = Promise[Any]()(provider.dispatcher)
val a = new PromiseActorRef(provider, path, provider.tempContainer, result, provider.deathWatch)
provider.registerTempActor(a, path)
val f = provider.scheduler.scheduleOnce(timeout.duration) { result.failure(new AskTimeoutException("Timed out")) }
val f = provider.scheduler.scheduleOnce(timeout.duration) { result.tryComplete(Left(new AskTimeoutException("Timed out"))) }
result onComplete { _
try { a.stop(); f.cancel() }
finally { provider.unregisterTempActor(path) }