class RichFuture[T] extends AnyRef
Useful enhancements to Future.
- Alphabetic
- By Inheritance
- RichFuture
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new RichFuture(fut: Future[T])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
failAfter(duration: FiniteDuration, msg: String): Future[T]
Cause this Future to fail with a FutureTimeoutException, with the given message, if it hasn't otherwise resolved in the given time.
Cause this Future to fail with a FutureTimeoutException, with the given message, if it hasn't otherwise resolved in the given time. Note that it is an error if the Future resolves *after* this time -- that will cause a double-resolution. So this is mainly intended as a backstop to prevent hangs.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
notYet: Future[T]
Guarantees that this Future will *not* complete synchronously.
Guarantees that this Future will *not* complete synchronously. If it is already completed, this returns a new Future that will return the same value after a minimal delay.
This is mainly useful for simplifying code paths so that you don't have to deal with Futures that return synchronously only during, eg, testing.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withTimeout: Future[T]
Simplest version of failAfter(): fails after 1 second, with a standard message.
Simplest version of failAfter(): fails after 1 second, with a standard message. Useful for sanity-checking, especially in testing.
-
def
withTimeout(msg: String): Future[T]
Simpler version of failAfter(), which will fail after 1 second.