Package akka.pattern

Class PromiseRef$


  • public class PromiseRef$
    extends java.lang.Object
    Wraps an ActorRef and a Promise into a PromiseRef.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static PromiseRef$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Constructor Summary

      Constructors 
      Constructor Description
      PromiseRef$()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PromiseRef<java.lang.Object> apply​(ActorSystem system, Timeout timeout)
      Constructs a new PromiseRef which will be completed with the first message sent to it.
      PromiseRef<java.lang.Object> apply​(Timeout timeout, ActorSystem system)
      Constructs a new PromiseRef which will be completed with the first message sent to it.
      <T> PromiseRef<T> wrap​(ActorRef actorRef, scala.concurrent.Promise<T> promise)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

        public static final PromiseRef$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • PromiseRef$

        public PromiseRef$()
    • Method Detail

      • wrap

        public <T> PromiseRef<T> wrap​(ActorRef actorRef,
                                      scala.concurrent.Promise<T> promise)
      • apply

        public PromiseRef<java.lang.Object> apply​(ActorSystem system,
                                                  Timeout timeout)
        Constructs a new PromiseRef which will be completed with the first message sent to it.

        
         // enables transparent use of PromiseRef as ActorRef and Promise
         import PromiseRef.Implicits._
        
         val promiseRef = PromiseRef(system, 5.seconds)
         promiseRef ! "message"
         promiseRef.onComplete(println)  // prints "message"
         
        Parameters:
        system - (undocumented)
        timeout - (undocumented)
        Returns:
        (undocumented)
      • apply

        public PromiseRef<java.lang.Object> apply​(Timeout timeout,
                                                  ActorSystem system)
        Constructs a new PromiseRef which will be completed with the first message sent to it.

        
         // enables transparent use of PromiseRef as ActorRef and Promise
         import PromiseRef.Implicits._
        
         // requires an implicit ActorSystem in scope
         val promiseRef = PromiseRef(5.seconds)
         promiseRef ! "message"
         promiseRef.future.onComplete(println)  // prints "message"
         
        Parameters:
        timeout - (undocumented)
        system - (undocumented)
        Returns:
        (undocumented)