Class MessageProducer<T>


  • public class MessageProducer<T>
    extends Object
    Represents a stream of message that can be written to.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • MessageProducer

        public MessageProducer​(io.vertx.core.eventbus.MessageProducer delegate)
      • MessageProducer

        public MessageProducer​(Object delegate,
                               TypeArg<T> typeArg_0)
      • MessageProducer

        public MessageProducer​(io.vertx.core.eventbus.MessageProducer delegate,
                               TypeArg<T> typeArg_0)
    • Method Detail

      • getDelegate

        public io.vertx.core.eventbus.MessageProducer getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • deliveryOptions

        public MessageProducer<T> deliveryOptions​(io.vertx.core.eventbus.DeliveryOptions options)
        Parameters:
        options - the new options
        Returns:
        this producer object
      • address

        public String address()
        Returns:
        The address to which the producer produces messages.
      • write

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> write​(T body)
        Write a message to the event-bus, either sending or publishing.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        body - the message body
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • writeAndAwait

        public Void writeAndAwait​(T body)
        Blocking variant of io.vertx.mutiny.core.eventbus.MessageProducer#write(T).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        body - the message body
        Returns:
        the Void instance produced by the operation.
      • writeAndForget

        public void writeAndForget​(T body)
        Variant of io.vertx.mutiny.core.eventbus.MessageProducer#write(T) that ignores the result of the operation.

        This method subscribes on the result of io.vertx.mutiny.core.eventbus.MessageProducer#write(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from io.vertx.mutiny.core.eventbus.MessageProducer#write(T) but you don't need to compose it with other operations.

        Parameters:
        body - the message body
      • close

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> close()
        Same as close() but with an handler called when the operation completes

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • closeAndAwait

        public Void closeAndAwait()
        Blocking variant of close().

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Returns:
        the Void instance produced by the operation.
      • closeAndForget

        public void closeAndForget()
        Variant of close() that ignores the result of the operation.

        This method subscribes on the result of close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from close() but you don't need to compose it with other operations.

      • newInstance

        public static <T> MessageProducer<T> newInstance​(io.vertx.core.eventbus.MessageProducer arg)
      • newInstance

        public static <T> MessageProducer<T> newInstance​(io.vertx.core.eventbus.MessageProducer arg,
                                                         TypeArg<T> __typeArg_T)