Minor cleanup in Future.scala
This commit is contained in:
parent
824d202b4a
commit
088e2029a6
1 changed files with 3 additions and 3 deletions
|
|
@ -869,8 +869,8 @@ class DefaultPromise[T](val timeout: Timeout) extends Promise[T] {
|
|||
this
|
||||
} else { //Limited wait
|
||||
val time = if (!atMost.isFinite) timeLeft() //If atMost is infinity, use preset timeout
|
||||
else if (!timeout.duration.isFinite) atMost.toNanos //If preset timeout is infinite, use atMost
|
||||
else atMost.toNanos min timeLeft() //Otherwise use the smallest of them
|
||||
else if (!timeout.duration.isFinite) atMost.toNanos //If preset timeout is infinite, use atMost
|
||||
else atMost.toNanos min timeLeft() //Otherwise use the smallest of them
|
||||
if (awaitUnsafe(time)) this
|
||||
else throw new FutureTimeoutException("Future timed out after [" + NANOS.toMillis(time) + "] ms")
|
||||
}
|
||||
|
|
@ -1002,7 +1002,7 @@ class DefaultPromise[T](val timeout: Timeout) extends Promise[T] {
|
|||
try {
|
||||
func(this)
|
||||
} catch {
|
||||
case e ⇒ EventHandler notify EventHandler.Error(e, this)
|
||||
case e ⇒ EventHandler.error(e, this, "Future onComplete-callback raised an exception")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue