Class EmitterImpl<T>

  • Type Parameters:
    T - the type of payload sent by the emitter.
    All Implemented Interfaces:
    EmitterBehavior, Emitter<T>

    public class EmitterImpl<T>
    extends AbstractEmitter<T>
    implements Emitter<T>
    Implementation of the emitter pattern.
    • Constructor Detail

    • Method Detail

      • send

        public CompletionStage<Void> send​(T payload)
        Description copied from interface: Emitter
        Sends a payload to the channel.

        A Message object will be created to hold the payload and the returned CompletionStage will be completed once this Message is acknowledged. If the Message is never acknowledged, then the CompletionStage will never be completed.

        Specified by:
        send in interface Emitter<T>
        Parameters:
        payload - the thing to send, must not be null
        Returns:
        the CompletionStage, which will be completed when the message for this payload is acknowledged.
      • send

        public <M extends Message<? extends T>> void send​(M msg)
        Description copied from interface: Emitter
        Sends a message to the channel.
        Specified by:
        send in interface Emitter<T>
        Type Parameters:
        M - the Message type
        Parameters:
        msg - the Message to send, must not be null