Implicit method that provides Timed implementation for any T.
Implicit method that provides Timed implementation for any T.
If the function completes before the timeout expires:
If the function completes after the timeout expires:
StackDepthException created from exceptionFun.StackDepthException created from exceptionFun that includes the exception thrown by the function as its cause.This implementation will start a timer that when the time limit is exceeded while the passed in function f is still running, it will attempt to call the passed in Signaler to signal/interrupt the running function f.
Implicit method that provides Timed implementation for any Future[T].
Implicit method that provides Timed implementation for any Future[T].
If the asynchronous function completes before the timeout expires:
Future will be completed with the return value of the function.Future with that same exception.If the asynchronous function completes after the timeout expires:
Future with a StackDepthException created from exceptionFun.Future with a StackDepthException created from exceptionFun that includes the exception thrown by the function as its cause.This implementation will start a timer that when the time limit is exceeded while the passed in asynchronous function f is still running, it will attempt to call the passed in Signaler to signal/interrupt the running function f.
Implicit method that provides Timed implementation for FutureOutcome.
Implicit method that provides Timed implementation for FutureOutcome.
If the asynchronous function completes before the timeout expires:
FutureOutcome will be completed with the Outcome returned from the function.TestPendingException, this method will complete the FutureOutcome with Pending.TestCanceledException, this method will complete the FutureOutcome with Canceled that contains the thrown exception.FutureOutcome with Failed that contains the thrown exception.FutureOutcome with ExecutionException that contains the thrown exception.If the asynchronous function completes after the timeout expires:
FutureOutcome with a Outcome that's mapped from the exception thrown from exceptionFun.FutureOutcome with Outcome that's mapped from the exception thrown from exceptionFun that includes the exception thrown by the function as its cause.This implementation will start a timer that when the time limit is exceeded while the passed in asynchronous function f is still running, it will attempt to call the passed in Signaler to signal/interrupt the running function f.
Companion object for
Timedtypeclass that offers three implicit providers: one forFutureOutcome, one forFutureof any type, and one for any other type.The details are in the documentation for the implicit providers themselves (methods
timed,timedFutureOf, andtimedFutureOutcome), but in short if a time limit is exceeded:TinTimed[T]isFutureOutcometheFutureOutcomereturned bytimeoutAfterwill result in eitherFailedorCanceledFuture[U], theFuture[U]returned bytimeoutAfterwill fail with either aTestFailedDueToTimeoutExceptionor aTestCanceledException.timeoutAftermethod will itself complete abruptly with eitherTestFailedDueToTimeoutExceptionorTestCanceledException.