Class MessageProducer<T>
- java.lang.Object
-
- io.vertx.mutiny.core.eventbus.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 theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MessageProducer>__TYPE_ARGTypeArg<T>__typeArg_0
-
Constructor Summary
Constructors Constructor Description MessageProducer(io.vertx.core.eventbus.MessageProducer delegate)MessageProducer(io.vertx.core.eventbus.MessageProducer delegate, TypeArg<T> typeArg_0)MessageProducer(Object delegate, TypeArg<T> typeArg_0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringaddress()io.smallrye.mutiny.Uni<Void>close()Same asclose()but with anhandlercalled when the operation completesVoidcloseAndAwait()Blocking variant ofclose().voidcloseAndForget()Variant ofclose()that ignores the result of the operation.MessageProducer<T>deliveryOptions(io.vertx.core.eventbus.DeliveryOptions options)booleanequals(Object o)io.vertx.core.eventbus.MessageProducergetDelegate()inthashCode()static <T> MessageProducer<T>newInstance(io.vertx.core.eventbus.MessageProducer arg)static <T> MessageProducer<T>newInstance(io.vertx.core.eventbus.MessageProducer arg, TypeArg<T> __typeArg_T)StringtoString()io.smallrye.mutiny.Uni<Void>write(T body)Write a message to the event-bus, either sending or publishing.VoidwriteAndAwait(T body)Blocking variant ofio.vertx.mutiny.core.eventbus.MessageProducer#write(T).voidwriteAndForget(T body)Variant ofio.vertx.mutiny.core.eventbus.MessageProducer#write(T)that ignores the result of the operation.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MessageProducer> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public io.vertx.core.eventbus.MessageProducer getDelegate()
-
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
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
public Void writeAndAwait(T body)
Blocking variant ofio.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 ofio.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 fromio.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 asclose()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose().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()
-
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)
-
-