implicit final class SMach_Concurrent_PimpMyFuture[A] extends AnyVal
- Alphabetic
- By Inheritance
- SMach_Concurrent_PimpMyFuture
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SMach_Concurrent_PimpMyFuture(self: Future[A])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
background(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
-
def
flatFold[X](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.
-
def
fold[X](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.
-
def
get(max: Duration): A
- returns
the result of the Future after it completes
- Exceptions thrown
java.util.concurrent.TimeoutException
if Future does not complete within max duration
-
def
get: A
- returns
the result of the Future after it completes (Note: this waits indefinitely for the Future to complete)
- Exceptions thrown
java.lang.Exception
Future completed with a failure, throws the exception
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
def
getTry(max: Duration): Try[A]
- returns
the Try result of the Future after it completes
- Exceptions thrown
java.util.concurrent.TimeoutException
if Future does not complete within max duration
-
def
getTry: Try[A]
- returns
the Try result of the Future after it completes (Note: this waits indefinitely for the Future to complete)
-
def
happensBefore[B](other: ⇒ Future[B])(implicit ec: ExecutionContext): DeferredFuture[B]
- returns
a future of A that is guaranteed to happen before lhs
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
onTimeout(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
- val self: Future[A]
-
def
sideEffect(sideEffect: ⇒ Unit)(implicit ec: ExecutionContext): Future[A]
- returns
execute a side effect after a future completes (even if it fails)
-
def
toString(): String
- Definition Classes
- Any
-
def
toTry(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