Packages

class Future[T] extends AnyRef

Represents the result of an action that may, or may not, have occurred yet.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Future
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Future(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
  6. def cause(): Throwable

    A Throwable describing failure.

    A Throwable describing failure. This will be null if the operation succeeded. * @return the cause or null if the operation succeeded.

  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. def complete(): Unit

    Set a null result.

    Set a null result. Any handler will be called, if there is one, and the future will be marked as completed.

  9. def complete(result: T): Unit

    Set the result.

    Set the result. Any handler will be called, if there is one, and the future will be marked as completed. * @param result the result

  10. def completer(): Handler[AsyncResult[T]]

    returns

    an handler completing this future

  11. def compose[U](successMapper: (T) ⇒ Future[U], failureMapper: (Throwable) ⇒ Future[U])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[U]): Future[U]

    Compose this future with a successMapper and failureMapper functions.

    Compose this future with a successMapper and failureMapper functions.

    When this future (the one on which compose is called) succeeds, the successMapper will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

    When this future (the one on which compose is called) fails, the failureMapper will be called with the failure and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

    If any mapper function throws an exception, the returned future will be failed with this exception. * @param successMapper the function mapping the success

    failureMapper

    the function mapping the failure

    returns

    the composed future

  12. def compose[U](mapper: (T) ⇒ Future[U])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[U]): Future[U]

    Compose this future with a mapper function.

    Compose this future with a mapper function.

    When this future (the one on which compose is called) succeeds, the mapper will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

    If the mapper throws an exception, the returned future will be failed with this exception.

    When this future fails, the failure will be propagated to the returned future and the mapper will not be called. * @param mapper the mapper function

    returns

    the composed future

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def fail(failureMessage: String): Unit

    Try to set the failure.

    Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed. * @param failureMessage the failure message

  16. def fail(cause: Throwable): Unit

    Set the failure.

    Set the failure. Any handler will be called, if there is one, and the future will be marked as completed. * @param cause the failure cause

  17. def failed(): Boolean

    Did it fail? * @return true if it failed or false otherwise

  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def flatMap[U](mapper: (T) ⇒ Future[U])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[U]): Future[U]

    Alias for io.vertx.scala.core.Future#compose.

  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def isComplete(): Boolean

    Has the future completed?

    Has the future completed?

    It's completed if it's either succeeded or failed. * @return true if completed, false if not

  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def map[V](value: V)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[V]): Future[V]

    Map the result of a future to a specific value.

    Map the result of a future to a specific value.

    When this future succeeds, this value will complete the future returned by this method call.

    When this future fails, the failure will be propagated to the returned future. * @param value the value that eventually completes the mapped future

    returns

    the mapped future

  25. def map[U](mapper: (T) ⇒ U)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[U]): Future[U]

    Apply a mapper function on this future.

    Apply a mapper function on this future.

    When this future succeeds, the mapper will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

    If the mapper throws an exception, the returned future will be failed with this exception.

    When this future fails, the failure will be propagated to the returned future and the mapper will not be called. * @param mapper the mapper function

    returns

    the mapped future

  26. def mapEmpty[V]()(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[V]): Future[V]

    Map the result of a future to null.

    Map the result of a future to null.

    This is a conveniency for future.map((T) null) or future.map((Void) null).

    When this future succeeds, null will complete the future returned by this method call.

    When this future fails, the failure will be propagated to the returned future. * @return the mapped future

  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. def onComplete(handler: Handler[AsyncResult[T]]): Future[T]

    Add a handler to be notified of the result.

    Add a handler to be notified of the result.
    * @param handler the handler that will be called with the result

    returns

    a reference to this, so it can be used fluently

  31. def onFailure(handler: Handler[Throwable]): Future[T]

    Add a handler to be notified of the failed result.

    Add a handler to be notified of the failed result.
    * @param handler the handler that will be called with the failed result

    returns

    a reference to this, so it can be used fluently

  32. def onSuccess(handler: Handler[T]): Future[T]

    Add a handler to be notified of the succeeded result.

    Add a handler to be notified of the succeeded result.
    * @param handler the handler that will be called with the succeeded result

    returns

    a reference to this, so it can be used fluently

  33. def otherwise(value: T): Future[T]

    Map the failure of a future to a specific value.

    Map the failure of a future to a specific value.

    When this future fails, this value will complete the future returned by this method call.

    When this future succeeds, the result will be propagated to the returned future. * @param value the value that eventually completes the mapped future

    returns

    the mapped future

  34. def otherwise(mapper: (Throwable) ⇒ T): Future[T]

    Apply a mapper function on this future.

    Apply a mapper function on this future.

    When this future fails, the mapper will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

    If the mapper throws an exception, the returned future will be failed with this exception.

    When this future succeeds, the result will be propagated to the returned future and the mapper will not be called. * @param mapper the mapper function

    returns

    the mapped future

  35. def otherwiseEmpty(): Future[T]

    Map the failure of a future to null.

    Map the failure of a future to null.

    This is a convenience for future.otherwise((T) null).

    When this future fails, the null value will complete the future returned by this method call.

    When this future succeeds, the result will be propagated to the returned future. * @return the mapped future

  36. def recover(mapper: (Throwable) ⇒ Future[T]): Future[T]

    Handles a failure of this Future by returning the result of another Future.

    Handles a failure of this Future by returning the result of another Future. If the mapper fails, then the returned future will be failed with this failure. * @param mapper A function which takes the exception of a failure and returns a new future.

    returns

    A recovered future

  37. def result(): T

    The result of the operation.

    The result of the operation. This will be null if the operation failed. * @return the result or null if the operation failed.

  38. def setHandler(handler: Handler[AsyncResult[T]]): Future[T]

    Like io.vertx.scala.core.Future#onComplete.

  39. def succeeded(): Boolean

    Did it succeed? * @return true if it succeded or false otherwise

  40. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  41. def toString(): String
    Definition Classes
    AnyRef → Any
  42. def tryComplete(): Boolean

    Try to set the result.

    Try to set the result. When it happens, any handler will be called, if there is one, and the future will be marked as completed. * @return false when the future is already completed

  43. def tryComplete(result: T): Boolean

    Set the failure.

    Set the failure. Any handler will be called, if there is one, and the future will be marked as completed. * @param result the result

    returns

    false when the future is already completed

  44. def tryFail(failureMessage: String): Boolean

    Try to set the failure.

    Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed. * @param failureMessage the failure message

    returns

    false when the future is already completed

  45. def tryFail(cause: Throwable): Boolean

    Try to set the failure.

    Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed. * @param cause the failure cause

    returns

    false when the future is already completed

  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped