akka.dispatch

AlreadyCompletedFuture

class AlreadyCompletedFuture [T] extends CompletableFuture[T]

An already completed Future is seeded with it's result at creation, is useful for when you are participating in a Future-composition but you already have a value to contribute.

Attributes
sealed
Linear Supertypes
CompletableFuture[T], Future[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. AlreadyCompletedFuture
  2. CompletableFuture
  3. Future
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AlreadyCompletedFuture (suppliedValue: Either[Throwable, T])

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def << (other: Future[T]): akka.dispatch.Future[T] @util.continuations.package.cps[akka.dispatch.Future[Any]]

    Attributes
    final
    Definition Classes
    CompletableFuture
  5. def << (value: T): akka.dispatch.Future[T] @util.continuations.package.cps[akka.dispatch.Future[Any]]

    Attributes
    final
    Definition Classes
    CompletableFuture
  6. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  7. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  8. def apply [A >: T] (): A @util.continuations.package.cps[akka.dispatch.Future[Any]]

    For use only within a Future.

    For use only within a Future.flow block or another compatible Delimited Continuations reset block.

    Returns the result of this Future without blocking, by suspending execution and storing it as a continuation until the result is available.

    If this Future is untyped (a Future[Nothing]), a type parameter must be explicitly provided or execution will fail. The normal result of getting a Future from an ActorRef using !!! will return an untyped Future.

    Definition Classes
    Future
  9. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  10. def await : Future[T]

    Blocks the current thread until the Future has been completed or the timeout has expired.

    Blocks the current thread until the Future has been completed or the timeout has expired. In the case of the timeout expiring a FutureTimeoutException will be thrown.

    Definition Classes
    AlreadyCompletedFutureFuture
  11. def await (atMost: Duration): Future[T]

    Blocks the current thread until the Future has been completed or the timeout has expired.

    Blocks the current thread until the Future has been completed or the timeout has expired. The timeout will be the least value of 'atMost' and the timeout supplied at the constructuion of this Future. In the case of the timeout expiring a FutureTimeoutException will be thrown.

    Definition Classes
    AlreadyCompletedFutureFuture
  12. def awaitBlocking : Future[T]

    Blocks the current thread until the Future has been completed.

    Blocks the current thread until the Future has been completed. Use caution with this method as it ignores the timeout and will block indefinitely if the Future is never completed.

    Definition Classes
    AlreadyCompletedFutureFuture
  13. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def collect [A] (pf: PartialFunction[Any, A]): Future[A]

    Creates a new Future by applying a PartialFunction to the successful result of this Future if a match is found, or else return a MatchError.

    Creates a new Future by applying a PartialFunction to the successful result of this Future if a match is found, or else return a MatchError. If this Future is completed with an exception then the new Future will also contain this exception. Example:

    val future1 = for {
      a <- actor !!! Req("Hello") collect { case Res(x: Int)    => x }
      b <- actor !!! Req(a)       collect { case Res(x: String) => x }
      c <- actor !!! Req(7)       collect { case Res(x: String) => x }
    } yield b + "-" + c
    

    Attributes
    final
    Definition Classes
    Future
  15. def complete (value: Either[Throwable, T]): CompletableFuture[T]

    Completes this Future with the specified result, if not already completed.

    Completes this Future with the specified result, if not already completed.

    returns

    this

    Definition Classes
    AlreadyCompletedFutureCompletableFuture
  16. def completeWith (other: Future[T]): Future[T]

    Completes this Future with the specified other Future, when that Future is completed, unless this Future has already been completed.

    Completes this Future with the specified other Future, when that Future is completed, unless this Future has already been completed.

    returns

    this.

    Attributes
    final
    Definition Classes
    CompletableFuture
  17. def completeWithException (exception: Throwable): Future[T]

    Completes this Future with the specified exception, if not already completed.

    Completes this Future with the specified exception, if not already completed.

    returns

    this

    Attributes
    final
    Definition Classes
    CompletableFuture
  18. def completeWithResult (result: T): Future[T]

    Completes this Future with the specified result, if not already completed.

    Completes this Future with the specified result, if not already completed.

    returns

    this

    Attributes
    final
    Definition Classes
    CompletableFuture
  19. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  20. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  21. def exception : Option[Throwable]

    Returns the contained exception of this Future if it exists.

    Returns the contained exception of this Future if it exists.

    Attributes
    final
    Definition Classes
    Future
  22. def failure [A >: T] (pf: PartialFunction[Throwable, A]): Future[A]

    Creates a new Future that will handle any matching Throwable that this Future might contain.

    Creates a new Future that will handle any matching Throwable that this Future might contain. If there is no match, or if this Future contains a valid result then the new Future will contain the same. Example:

    Future(6 / 0) failure { case e: ArithmeticException => 0 } // result: 0
    Future(6 / 0) failure { case e: NotFoundException   => 0 } // result: exception
    Future(6 / 2) failure { case e: ArithmeticException => 0 } // result: 3
    

    Attributes
    final
    Definition Classes
    Future
  23. def filter (p: Function[Any, Boolean]): Future[Any]

    Attributes
    final
    Definition Classes
    Future
  24. def filter (p: (Any) ⇒ Boolean): Future[Any]

    Attributes
    final
    Definition Classes
    Future
  25. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. def flatMap [A >: T, B] (f: Function[A, Future[B]]): Future[B]

    Attributes
    final
    Definition Classes
    Future
  27. def flatMap [A] (f: (T) ⇒ Future[A]): Future[A]

    Creates a new Future by applying a function to the successful result of this Future, and returns the result of the function as the new Future.

    Creates a new Future by applying a function to the successful result of this Future, and returns the result of the function as the new Future. If this Future is completed with an exception then the new Future will also contain this exception. Example:

    val future1 = for {
      a: Int    <- actor !!! "Hello" // returns 5
      b: String <- actor !!! a       // returns "10"
      c: String <- actor !!! 7       // returns "14"
    } yield b + "-" + c
    

    Attributes
    final
    Definition Classes
    Future
  28. def foreach [A >: T] (proc: Procedure[A]): Unit

    Attributes
    final
    Definition Classes
    Future
  29. def foreach (f: (T) ⇒ Unit): Unit

    Attributes
    final
    Definition Classes
    Future
  30. def get : T

    Blocks awaiting completion of this Future, then returns the resulting value, or throws the completed exception

    Blocks awaiting completion of this Future, then returns the resulting value, or throws the completed exception

    Scala & Java API

    throws FutureTimeoutException if this Future times out when waiting for completion

    Definition Classes
    Future
  31. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  32. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  33. def isCompleted : Boolean

    Tests whether this Future has been completed.

    Tests whether this Future has been completed.

    Attributes
    final
    Definition Classes
    Future
  34. def isExpired : Boolean

    Tests whether this Future's timeout has expired.

    Tests whether this Future's timeout has expired.

    Note that an expired Future may still contain a value, or it may be completed with a value.

    Definition Classes
    AlreadyCompletedFutureFuture
  35. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  36. def map [A >: T, B] (f: Function[A, B]): Future[B]

    Attributes
    final
    Definition Classes
    Future
  37. def map [A] (f: (T) ⇒ A): Future[A]

    Creates a new Future by applying a function to the successful result of this Future.

    Creates a new Future by applying a function to the successful result of this Future. If this Future is completed with an exception then the new Future will also contain this exception. Example:

    val future1 = for {
      a: Int    <- actor !!! "Hello" // returns 5
      b: String <- actor !!! a       // returns "10"
      c: String <- actor !!! 7       // returns "14"
    } yield b + "-" + c
    

    Attributes
    final
    Definition Classes
    Future
  38. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  39. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  40. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  41. def onComplete (func: (Future[T]) ⇒ Unit): Future[T]

    When this Future is completed, apply the provided function to the Future.

    When this Future is completed, apply the provided function to the Future. If the Future has already been completed, this will apply immediately.

    Definition Classes
    AlreadyCompletedFutureFuture
  42. def onComplete [A >: T] (proc: Procedure[Future[A]]): Future[T]

    Attributes
    final
    Definition Classes
    Future
  43. def receive (pf: PartialFunction[Any, Unit]): Future[T]

    When the future is completed with a valid result, apply the provided PartialFunction to the result.

    When the future is completed with a valid result, apply the provided PartialFunction to the result.

      val result = future receive {
        case Foo => "foo"
        case Bar => "bar"
      }.await.result
    

    Attributes
    final
    Definition Classes
    Future
  44. def result : Option[T]

    Returns the successful result of this Future if it exists.

    Returns the successful result of this Future if it exists.

    Attributes
    final
    Definition Classes
    Future
  45. def resultOrException : Option[T]

    Returns the current result, throws the exception is one has been raised, else returns None

    Returns the current result, throws the exception is one has been raised, else returns None

    Attributes
    final
    Definition Classes
    Future
  46. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  47. def timeoutInNanos : Long

    This Future's timeout in nanoseconds.

    This Future's timeout in nanoseconds.

    Definition Classes
    AlreadyCompletedFutureFuture
  48. def toString (): String

    Definition Classes
    AnyRef → Any
  49. val value : Some[Either[Throwable, T]]

    The contained value of this Future.

    The contained value of this Future. Before this Future is completed the value will be None. After completion the value will be Some(Right(t)) if it contains a valid result, or Some(Left(error)) if it contains an exception.

    Definition Classes
    AlreadyCompletedFutureFuture
  50. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  51. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  52. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from CompletableFuture[T]

Inherited from Future[T]

Inherited from AnyRef

Inherited from Any