Class MessageProducer<T>
- java.lang.Object
-
- io.vertx.mutiny.core.eventbus.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 theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MessageProducer>__TYPE_ARGTypeArg<T>__typeArg_0static intDEFAULT_WRITE_QUEUE_MAX_SIZE
-
Constructor Summary
Constructors Constructor Description MessageProducer(io.vertx.core.eventbus.MessageProducer delegate)MessageProducer(io.vertx.core.eventbus.MessageProducer delegate, TypeArg<T> typeArg_0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated 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)MessageProducer<T>drainHandler(Consumer<Void> handler)io.smallrye.mutiny.Uni<Void>end()Closes the producer, callsclose()io.smallrye.mutiny.Uni<Void>end(T data)Same as but with anhandlercalled when the operation completesVoidendAndAwait()Blocking variant ofWriteStream.end().VoidendAndAwait(T data)Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(T).voidendAndForget()Variant ofWriteStream.end()that ignores the result of the operation.voidendAndForget(T data)Variant ofio.vertx.mutiny.core.streams.WriteStream#end(T)that ignores the result of the operation.booleanequals(Object o)MessageProducer<T>exceptionHandler(Consumer<Throwable> handler)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)<R> io.smallrye.mutiny.Uni<Message<R>>send(T message)Deprecated.<R> Message<R>sendAndAwait(T message)Deprecated.MessageProducer<T>sendAndForget(T message)Deprecated.MessageProducer<T>setWriteQueueMaxSize(int maxSize)StringtoString()WriteStreamSubscriber<T>toSubscriber()io.smallrye.mutiny.Uni<Void>write(T data)Same as but with anhandlercalled when the operation completesVoidwriteAndAwait(T data)Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(T).MessageProducer<T>writeAndForget(T data)booleanwriteQueueFull()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MessageProducer> __TYPE_ARG
-
DEFAULT_WRITE_QUEUE_MAX_SIZE
public static final int DEFAULT_WRITE_QUEUE_MAX_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDelegate
public io.vertx.core.eventbus.MessageProducer getDelegate()
- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWriteStream<T>
-
toSubscriber
public WriteStreamSubscriber<T> toSubscriber()
-
end
public io.smallrye.mutiny.Uni<Void> end(T data)
Same as 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.- Specified by:
endin interfaceWriteStream<T>- Parameters:
data-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
public Void endAndAwait(T data)
Blocking variant ofio.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:
endAndAwaitin interfaceWriteStream<T>- Parameters:
data-- Returns:
- the Void instance produced by the operation
-
writeQueueFull
public boolean writeQueueFull()
- Specified by:
writeQueueFullin interfaceWriteStream<T>- Returns:
- true if write queue is full
-
send
@Deprecated public <R> io.smallrye.mutiny.Uni<Message<R>> send(T message)
Deprecated.Likesend(T)but specifying areplyHandlerthat 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 ofio.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
-
exceptionHandler
public MessageProducer<T> exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandlerin interfaceStreamBase- Specified by:
exceptionHandlerin interfaceWriteStream<T>- Parameters:
handler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
write
public io.smallrye.mutiny.Uni<Void> write(T data)
Description copied from interface:WriteStreamSame as 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.- Specified by:
writein interfaceWriteStream<T>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
public Void writeAndAwait(T data)
Description copied from interface:WriteStreamBlocking variant ofio.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:
writeAndAwaitin interfaceWriteStream<T>- Returns:
- the Void instance produced by the operation
-
setWriteQueueMaxSize
public MessageProducer<T> setWriteQueueMaxSize(int maxSize)
- Specified by:
setWriteQueueMaxSizein interfaceWriteStream<T>- Parameters:
maxSize- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
drainHandler
public MessageProducer<T> drainHandler(Consumer<Void> handler)
- Specified by:
drainHandlerin interfaceWriteStream<T>- Parameters:
handler- the handler- 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, callsclose()Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
endin interfaceWriteStream<T>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
public Void endAndAwait()
Blocking variant ofWriteStream.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:
endAndAwaitin interfaceWriteStream<T>- Returns:
- the Void instance produced by the operation
-
close
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
-
endAndForget
public void endAndForget(T data)
Variant ofio.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 fromio.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 ofio.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 fromio.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
-
writeAndForget
public MessageProducer<T> writeAndForget(T data)
-
endAndForget
public void endAndForget()
Variant ofWriteStream.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 fromWriteStream.end()but you don't need to compose it with other operations.
-
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)
-
-