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 Details

    • 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

      default boolean isConnected(Cascade.Stage.Actor.Output<?> output)
      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

      default boolean offer(T message)
      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 the message is null.
    • send

      default Cascade.Stage.Actor.Input<T> send(T message)
      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.