Package com.mackenziehigh.cascade
Interface Cascade.Stage.Actor.Input<T>
- Type Parameters:
T- is the type of messages that the actor will consume.
- Enclosing interface:
- Cascade.Stage.Actor<I,
O>
public static interface Cascade.Stage.Actor.Input<T>
Input to an Actor.
-
Method Summary
Modifier and TypeMethodDescriptionactor()Get the actor that this input pertains to.default Cascade.Stage.Actor.Input<T>connect(Cascade.Stage.Actor.Output<T> output) Connect this input to the given output of another actor.default Cascade.Stage.Actor.Input<T>disconnect(Cascade.Stage.Actor.Output<T> output) Disconnect this input from the given output.default booleanisConnected(Cascade.Stage.Actor.Output<?> output) Determine whether this input is connected to the given output.default booleanSend a message to the actor via this input, silently dropping the message, if this input does not have sufficient capacity to enqueue the message.default Cascade.Stage.Actor.Input<T>Send a message to the actor via this input.
-
Method Details
-
actor
Cascade.Stage.Actor<T,?> actor()Get the actor that this input pertains to.- Returns:
- the enclosing actor.
-
connect
Connect this input to the given output of another actor.This method is a no-op, if the connection already exists.
Implementations should not override the default behavior of this method as defined in this interface.
- Parameters:
output- will send messages to this input.- Returns:
- this.
-
disconnect
Disconnect this input from the given output.This method is a no-op, if the connection does not exist.
Implementations should not override the default behavior of this method as defined in this interface.
- Parameters:
output- will no longer be connected.- Returns:
- this.
-
isConnected
Determine whether this input is connected to the given output.Implementations should not override the default behavior of this method as defined in this interface.
- Parameters:
output- may be connected to this input.- Returns:
- true, if this input is currently connected to the output.
-
offer
Send a message to the actor via this input, silently dropping the message, if this input does not have sufficient capacity to enqueue the message.Equivalent:
return actor().context().offerTo(message);- Parameters:
message- will be processed by the actor, eventually, if the message is not dropped due to capacity restrictions.- Returns:
- true, if the message was successfully added to the underlying mailbox.
- Throws:
NullPointerException- if themessageis null.
-
send
Send a message to the actor via this input.Equivalent:
offer(message); return this;- Parameters:
message- will be processed by the actor, eventually, if the message was not dropped due to capacity restrictions.- Returns:
- this.
-