Class MessageProducer<T>

  • All Implemented Interfaces:
    StreamBase, WriteStream<T>

    public class MessageProducer<T>
    extends Object
    implements WriteStream<T>
    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​(io.vertx.core.eventbus.MessageProducer delegate,
                               TypeArg<T> typeArg_0)
    • Method Detail

      • hashCode

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

        public io.smallrye.mutiny.Uni<Void> end​(T data)
        Same as 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.

        Specified by:
        end in interface WriteStream<T>
        Parameters:
        data -
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • endAndAwait

        public Void endAndAwait​(T data)
        Blocking variant of io.vertx.mutiny.core.streams.WriteStream#end(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).

        Specified by:
        endAndAwait in interface WriteStream<T>
        Parameters:
        data -
        Returns:
        the Void instance produced by the operation
      • writeQueueFull

        public boolean writeQueueFull()
        Specified by:
        writeQueueFull in interface WriteStream<T>
        Returns:
        true if write queue is full
      • send

        @Deprecated
        public <R> io.smallrye.mutiny.Uni<Message<R>> send​(T message)
        Deprecated.
        Like send(T) but specifying a replyHandler that will be called if the recipient subsequently replies to the message.

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

        Parameters:
        message - the message to send
        Returns:
        reference to this for fluency
      • sendAndAwait

        @Deprecated
        public <R> Message<R> sendAndAwait​(T message)
        Deprecated.
        Blocking variant of io.vertx.mutiny.core.eventbus.MessageProducer#send(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:
        message - the message to send
        Returns:
        reference to this for fluency
      • write

        public io.smallrye.mutiny.Uni<Void> write​(T data)
        Description copied from interface: WriteStream
        Same as 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.

        Specified by:
        write in interface WriteStream<T>
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • writeAndAwait

        public Void writeAndAwait​(T data)
        Description copied from interface: WriteStream
        Blocking variant of io.vertx.mutiny.core.streams.WriteStream#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).

        Specified by:
        writeAndAwait in interface WriteStream<T>
        Returns:
        the Void instance produced by the operation
      • setWriteQueueMaxSize

        public MessageProducer<T> setWriteQueueMaxSize​(int maxSize)
        Specified by:
        setWriteQueueMaxSize in interface WriteStream<T>
        Parameters:
        maxSize - the max size of the write stream
        Returns:
        a reference to this, so the API can be used fluently
      • 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.
      • end

        public io.smallrye.mutiny.Uni<Void> end()
        Closes the producer, calls close()

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

        Specified by:
        end in interface WriteStream<T>
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • endAndAwait

        public Void endAndAwait()
        Blocking variant of WriteStream.end().

        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).

        Specified by:
        endAndAwait in interface WriteStream<T>
        Returns:
        the Void instance produced by the operation
      • close

        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
      • endAndForget

        public void endAndForget​(T data)
        Variant of io.vertx.mutiny.core.streams.WriteStream#end(T) that ignores the result of the operation.

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

        Parameters:
        data - the data to write
      • sendAndForget

        @Deprecated
        public MessageProducer<T> sendAndForget​(T message)
        Deprecated.
        Variant of io.vertx.mutiny.core.eventbus.MessageProducer#send(T) that ignores the result of the operation.

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

        Parameters:
        message - the message to send
        Returns:
        reference to this for fluency
      • endAndForget

        public void endAndForget()
        Variant of WriteStream.end() that ignores the result of the operation.

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

      • 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)