object FutureOps extends FutureOps
- Alphabetic
- By Inheritance
- FutureOps
- FutureOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
val
_unit: Future[Unit]
- Definition Classes
- FutureOps
-
def
background[A](self: Future[A])(implicit ec: ExecutionContext): Unit
Run future in the background.
Run future in the background. Discard the result of this Future but ensure if there is an exception it gets reported to the ExecutionContext
- Definition Classes
- FutureOps
- Annotations
- @inline()
-
def
firstSuccess[A](xa: Traversable[Future[A]])(implicit ec: ExecutionContext): Future[A]
- returns
the first successfully completed future. If all futures fail, then completes the future with AsyncParThrowable of all failures.
- Definition Classes
- FutureOps
-
def
flatFold[A, X](self: Future[A], onSuccess: (A) ⇒ Future[X], onFailure: (Throwable) ⇒ Future[X])(implicit ec: ExecutionContext): Future[X]
- returns
a Future of X that always succeeds. If self is successful, X is derived from onSuccess otherwise if self is a failure, X is derived from onFailure.
- Definition Classes
- FutureOps
-
def
fold[A, X](self: Future[A], onSuccess: (A) ⇒ X, onFailure: (Throwable) ⇒ X)(implicit ec: ExecutionContext): Future[X]
- returns
a Future of X that always succeeds. If self is successful, X is derived from onSuccess otherwise if self is a failure, X is derived from onFailure.
- Definition Classes
- FutureOps
-
def
get[A](self: Future[A], max: Duration): A
- returns
the result of the Future after it completes
- Definition Classes
- FutureOps
- Annotations
- @inline()
- Exceptions thrown
java.util.concurrent.TimeoutException
if Future does not complete within max duration
-
def
get[A](self: Future[A]): A
- returns
the result of the Future after it completes (Note: this waits indefinitely for the Future to complete)
- Definition Classes
- FutureOps
- Annotations
- @inline()
- Exceptions thrown
java.lang.Exception
Future completed with a failure, throws the exception
-
def
getTry[A](self: Future[A], max: Duration): Try[A]
- returns
the Try result of the Future after it completes
- Definition Classes
- FutureOps
- Annotations
- @inline()
- Exceptions thrown
java.util.concurrent.TimeoutException
if Future does not complete within max duration
-
def
getTry[A](self: Future[A]): Try[A]
- returns
the Try result of the Future after it completes (Note: this waits indefinitely for the Future to complete)
- Definition Classes
- FutureOps
- Annotations
- @inline()
-
def
happensBefore[A](lhs: Future[Any], rhs: ⇒ Future[A])(implicit ec: ExecutionContext): DeferredFuture[A]
- returns
a future of A that is guaranteed to happen before lhs
- Definition Classes
- FutureOps
-
def
nanoSpinDelay(delay_ns: Long): Long
- returns
after spinning the current thread for delay_ns, returns the error between the requested delay and the actual delay. Use this function only when a precise delay is more important than overall performance.
- Definition Classes
- FutureOps
-
def
onTimeout[A](self: Future[A], timeout: FiniteDuration)(fallback: ⇒ Future[A])(implicit ec: ExecutionContext, sec: ScheduledExecutionContext): Future[A]
- returns
a future that completes with fallback if the specified timeout is exceeded, otherwise the completed result of the future
- Definition Classes
- FutureOps
-
def
sideEffect[A](self: Future[A], sideEffect: ⇒ Unit)(implicit ec: ExecutionContext): Future[A]
- returns
a future that completes once the supplied Future and the supplied side effect complete. The side effect runs after the supplied future completes even if it fails.
- Definition Classes
- FutureOps
-
def
toTry[A](self: Future[A])(implicit ec: ExecutionContext): Future[Try[A]]
- returns
a Future of a Try of the result that always completes successfully even if the Future eventually throws an exception
- Definition Classes
- FutureOps
-
def
unit: Future[Unit]
- Definition Classes
- FutureOps
- Annotations
- @inline()