akka.dispatch

ActorCompletableFuture

class ActorCompletableFuture extends DefaultCompletableFuture[Any] with ForwardableChannel with ExceptionChannel[Any]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ActorCompletableFuture
  2. ExceptionChannel
  3. ForwardableChannel
  4. AvailableChannel
  5. UntypedChannel
  6. Channel
  7. Channel
  8. DefaultCompletableFuture
  9. CompletableFuture
  10. Future
  11. Future
  12. AnyRef
  13. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ActorCompletableFuture (timeout: Long)(implicit dispatcher: MessageDispatcher)

  2. new ActorCompletableFuture ()(implicit dispatcher: MessageDispatcher)

  3. new ActorCompletableFuture (timeout: Long, timeunit: TimeUnit)(implicit dispatcher: MessageDispatcher)

Value Members

  1. def ! (message: Any)(implicit channel: UntypedChannel): Unit

    Scala API.

    Scala API.

    Sends the specified message to the channel.

    Definition Classes
    ActorCompletableFutureChannel
  2. def != (arg0: AnyRef): Boolean

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

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  9. def apply [A >: Any] (): 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
  10. def as [A] (implicit m: Manifest[A]): Option[A]

    Await completion of this Future and return its value if it conforms to A's erased type.

    Await completion of this Future and return its value if it conforms to A's erased type. Will throw a ClassCastException if the value does not conform, or any exception the Future was completed with. Will return None in case of a timeout.

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

    Attributes
    final
    Definition Classes
    Any
  12. def asSilently [A] (implicit m: Manifest[A]): Option[A]

    Await completion of this Future and return its value if it conforms to A's erased type, None otherwise.

    Await completion of this Future and return its value if it conforms to A's erased type, None otherwise. Will throw any exception the Future was completed with. Will return None in case of a timeout.

    Definition Classes
    Future
  13. def await : DefaultCompletableFuture[Any]

    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
    DefaultCompletableFutureFuture
  14. def await (atMost: Duration): DefaultCompletableFuture[Any]

    Blocks the current thread until the Future has been completed or the timeout has expired, additionally bounding the waiting period according to the atMost parameter.

    Blocks the current thread until the Future has been completed or the timeout has expired, additionally bounding the waiting period according to the atMost parameter. The timeout will be the lesser 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. Other callers of this method are not affected by the additional bound imposed by atMost.

    Definition Classes
    DefaultCompletableFutureFuture
  15. def awaitThenThrow (waitNanos: Long): ActorCompletableFuture.this.type

    Attributes
    protected
    Definition Classes
    DefaultCompletableFuture
  16. def channel : UntypedChannel

    Get channel by which this channel would reply (used by ActorRef.

    Get channel by which this channel would reply (used by ActorRef.forward)

    Definition Classes
    ActorCompletableFutureForwardableChannel
  17. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  18. def complete (value: Either[Throwable, Any]): ActorCompletableFuture.this.type

    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
    DefaultCompletableFutureCompletableFuture
  19. def completeWith (other: Future[Any]): ActorCompletableFuture.this.type

    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
  20. def completeWithException (exception: Throwable): ActorCompletableFuture.this.type

    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
  21. def completeWithResult (result: Any): ActorCompletableFuture.this.type

    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
  22. def eq (arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  24. 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
  25. def filter (p: (Any) ⇒ Boolean): Future[Any]

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def flatMap [A] (f: (Any) ⇒ 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 (f: (Any) ⇒ Unit): Unit

    Attributes
    final
    Definition Classes
    Future
  29. def get : Any

    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
  30. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  31. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  32. def isCompleted : Boolean

    Tests whether this Future has been completed.

    Tests whether this Future has been completed.

    Attributes
    final
    Definition Classes
    Future
  33. 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
    DefaultCompletableFutureFuture
  34. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  35. def map [A] (f: (Any) ⇒ 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
  36. def mapTo [A] (implicit m: Manifest[A]): Future[A]

    Creates a new Future[A] which is completed with this Future's result if that conforms to A's erased type or a ClassCastException otherwise.

    Creates a new Future[A] which is completed with this Future's result if that conforms to A's erased type or a ClassCastException otherwise.

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  40. def onComplete (func: (Future[Any]) ⇒ Unit): ActorCompletableFuture.this.type

    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. Will not be called in case of a timeout, which also holds if corresponding Promise is attempted to complete after expiry. Multiple callbacks may be registered; there is no guarantee that they will be executed in a particular order.

    Definition Classes
    DefaultCompletableFutureFuture
  41. def onException (pf: PartialFunction[Throwable, Unit]): ActorCompletableFuture.this.type

    When the future is completed with an exception, apply the provided PartialFunction to the exception.

    When the future is completed with an exception, apply the provided PartialFunction to the exception. See onComplete for more details.

      future onException {
        case NumberFormatException ⇒ target ! "wrong format"
      }
    

    Attributes
    final
    Definition Classes
    Future
  42. def onResult (pf: PartialFunction[Any, Unit]): ActorCompletableFuture.this.type

    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. See onComplete for more details.

      future onResult {
        case Foo ⇒ target ! "foo"
        case Bar ⇒ target ! "bar"
      }
    

    Attributes
    final
    Definition Classes
    Future
  43. def onTimeout (func: (Future[Any]) ⇒ Unit): ActorCompletableFuture.this.type

    Registers a function that will be executed when this Future times out.

    Registers a function that will be executed when this Future times out.

       future onTimeout {
         f => doSomethingOnTimeout(f)
       }
    

    Definition Classes
    DefaultCompletableFutureFuture
  44. def recover [A >: Any] (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
  45. def result : Option[Any]

    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
  46. def resultOrException : Option[Any]

    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
  47. def sendException (ex: Throwable): Boolean

    Try to send an exception.

    Try to send an exception. Not all channel types support this, one notable positive example is Future. Failure to send is silent.

    returns

    whether sending was successful

    Definition Classes
    ActorCompletableFutureChannel
  48. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  49. def tell (msg: Any, sender: UntypedChannel): Unit

    Java API.

    Java API.

    Sends the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    actor.tell(message, context);
    

    Definition Classes
    Channel
  50. def tell (msg: Any): Unit

    Java API.

    Java API.

    Sends the specified message to the channel, i.e. fire-and-forget semantics.

    actor.tell(message);
    

    Definition Classes
    Channel
  51. val timeoutInNanos : Long

    This Future's timeout in nanoseconds.

    This Future's timeout in nanoseconds.

    Definition Classes
    DefaultCompletableFutureFuture
  52. def toString (): String

    Definition Classes
    AnyRef → Any
  53. def tryTell (msg: Any)(implicit sender: UntypedChannel): Boolean

    Scala and Java API.

    Scala and Java API.

    Try to send the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    From Java:

    actor.tryTell(message);
    actor.tryTell(message, context);
    

    From Scala:

    actor tryTell message
    actor.tryTell(message)(sender)
    

    Definition Classes
    Channel
  54. def value : Option[Either[Throwable, Any]]

    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
    DefaultCompletableFutureFuture
  55. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. 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
    Annotations
    @deprecated
    Deprecated

    No longer needed, use 'map' instead. Removed in 2.0

  2. def failure [A >: Any] (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
    Annotations
    @deprecated
    Deprecated

    will be replaced by recover

  3. def future : ActorCompletableFuture

    Annotations
    @deprecated
    Deprecated

    ActorCompletableFuture merged with Channel[Any], just use 'this'

  4. def receive (pf: PartialFunction[Any, Unit]): ActorCompletableFuture.this.type

    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. See onComplete for more details.

      future receive {
        case Foo ⇒ target ! "foo"
        case Bar ⇒ target ! "bar"
      }
    

    Attributes
    final
    Definition Classes
    Future
    Annotations
    @deprecated
    Deprecated

    Use onResult instead, will be removed in the future

  5. def sendOneWay (msg: Any, sender: UntypedChannel): Unit

    Java API.

    Java API.

    Sends the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    actor.sendOneWay(message, context);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tell' instead

  6. def sendOneWay (msg: Any): Unit

    Sends the specified message to the channel, i.

    Sends the specified message to the channel, i.e. fire-and-forget semantics.

    actor.sendOneWay(message);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tell' instead

  7. def sendOneWaySafe (msg: Any, sender: UntypedChannel): Boolean

    Java API.

    Java API.

    Try to send the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    actor.sendOneWay(message, context);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tryTell' instead

  8. def sendOneWaySafe (msg: Any): Boolean

    Java API.

    Java API.

    Try to send the specified message to the channel, i.e. fire-and-forget semantics.

    actor.sendOneWay(message);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tryTell' instead

Inherited from ExceptionChannel[Any]

Inherited from ForwardableChannel

Inherited from AvailableChannel[Any]

Inherited from UntypedChannel

Inherited from Channel[Any]

Inherited from Channel[Any]

Inherited from DefaultCompletableFuture[Any]

Inherited from CompletableFuture[Any]

Inherited from Future[Any]

Inherited from Future[Any]

Inherited from AnyRef

Inherited from Any