Package actors
Class ActorRef<I,O>
- java.lang.Object
-
- actors.ActorRef<I,O>
-
- Type Parameters:
I
- the type of the input message sent to this actorO
- the type of the output message returned by this actor
public class ActorRef<I,O> extends Object
It represents a reference to an actor, the unit of computation. It allows to send messages to the actor with the methodtell(DeliveryOptions)
, or establish conversations with the methodask(DeliveryOptions)
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<I,io.vertx.core.Future<O>>
ask()
Method to establish a conversation with this actor: a message is sent and then a message is received.Function<I,io.vertx.core.Future<O>>
ask(io.vertx.core.eventbus.DeliveryOptions options)
Method to establish a conversation with this actor: a message is sent and then a message is received.Consumer<I>
tell()
Method to send a message to this actor.Consumer<I>
tell(io.vertx.core.eventbus.DeliveryOptions options)
Method to send a message to this actor.io.vertx.core.Future<Void>
undeploy()
Undeploy all the instances of this actor
-
-
-
Method Detail
-
ask
public Function<I,io.vertx.core.Future<O>> ask(io.vertx.core.eventbus.DeliveryOptions options)
Method to establish a conversation with this actor: a message is sent and then a message is received.- Parameters:
options
- the delivery options- Returns:
- a function that takes an object of type I and returns an object of type O wrapped in a future
-
ask
public Function<I,io.vertx.core.Future<O>> ask()
Method to establish a conversation with this actor: a message is sent and then a message is received.- Returns:
- a function that takes an object of type I and returns an object of type O wrapped in a future
-
tell
public Consumer<I> tell(io.vertx.core.eventbus.DeliveryOptions options)
Method to send a message to this actor.- Parameters:
options
- the delivery options- Returns:
- a consumer that takes an object of type I
-
tell
public Consumer<I> tell()
Method to send a message to this actor.- Returns:
- a consumer that takes an object of type I
-
undeploy
public io.vertx.core.Future<Void> undeploy()
Undeploy all the instances of this actor- Returns:
- a future that will be completed when all the instances are undeployed
-
-