Packages

object FutureRef

Source
PromiseRef.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FutureRef
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def apply(timeout: Timeout)(implicit system: ActorSystem): FutureRef[Any]

    Constructs a new PromiseRef which will be completed with the first message sent to it.

    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"
  2. def apply(system: ActorSystem, timeout: Timeout): FutureRef[Any]

    Constructs a new FutureRef which will be completed with the first message sent to it.

    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"