Package akka.pattern

Class FutureRef$


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

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

      Constructors 
      Constructor Description
      FutureRef$()  
    • Method Summary

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

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

      • MODULE$

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

      • FutureRef$

        public FutureRef$()
    • Method Detail

      • wrap

        public <T> FutureRef<T> wrap​(ActorRef actorRef,
                                     scala.concurrent.Future<T> future)
      • apply

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

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

        public FutureRef<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 FutureRef as ActorRef and Promise
         import FutureRef.Implicits._
        
         // requires an implicit ActorSystem in scope
         val futureRef = FutureRef(5.seconds)
         futureRef ! "message"
         futureRef.onComplete(println)  // prints "message"
         
        Parameters:
        timeout - (undocumented)
        system - (undocumented)
        Returns:
        (undocumented)