Class MutinyEmitterImpl<T>

    • Constructor Detail

      • MutinyEmitterImpl

        public MutinyEmitterImpl​(EmitterConfiguration config,
                                 long defaultBufferSize)
    • Method Detail

      • send

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> send​(T payload)
        Description copied from interface: MutinyEmitter
        Sends a payload to the channel.

        A Message object will be created to hold the payload and the returned Uni can be subscribed to for triggering the send. When subscribed, a null item will be passed to the Uni when the Message is acknowledged. If the Message is never acknowledged, then the Uni will never be completed.

        The Message will not be sent to the channel until the Uni has been subscribed to:

         emitter.send("a").subscribe().with(x -> {
         });
         
        Specified by:
        send in interface MutinyEmitter<T>
        Parameters:
        payload - the thing to send, must not be null
        Returns:
        the Uni, that requires subscription to send the Message.
      • sendAndAwait

        public void sendAndAwait​(T payload)
        Description copied from interface: MutinyEmitter
        Sends a payload to the channel.

        A Message object will be created to hold the payload.

        Execution will block waiting for the resulting Message to be acknowledged before returning.

        Specified by:
        sendAndAwait in interface MutinyEmitter<T>
        Parameters:
        payload - the thing to send, must not be null
      • sendAndForget

        public io.smallrye.mutiny.subscription.Cancellable sendAndForget​(T payload)
        Description copied from interface: MutinyEmitter
        Sends a payload to the channel without waiting for acknowledgement.

        A Message object will be created to hold the payload.

        Specified by:
        sendAndForget in interface MutinyEmitter<T>
        Parameters:
        payload - the thing to send, must not be null
        Returns:
        the Cancellable from the subscribed Uni.
      • send

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