FutureRef

org.apache.pekko.pattern.FutureRef
See theFutureRef companion trait
object FutureRef

Attributes

Companion
trait
Source
PromiseRef.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
FutureRef.type

Members list

Value members

Concrete methods

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"

Attributes

Source
PromiseRef.scala
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"

Attributes

Source
PromiseRef.scala