Class MessageConsumer<T>
- All Implemented Interfaces:
MutinyDelegate,ReadStream<Message<T>>,StreamBase
EventBus address that can
be read from.
The EventBus.consumer(String) or EventBus.localConsumer(String)
creates a new consumer, the returned consumer is not yet registered against the event bus. Registration
is effective after the #handler(io.vertx.core.Handler) method is invoked.
The consumer is unregistered from the event bus using the unregister() method or by calling the
#handler(io.vertx.core.Handler) with a null value..
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Nick Scavelli
- See Also:
-
MessageConsumer
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.ReadStream
ReadStream.ReadStreamImpl<T>Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMessageConsumer(io.vertx.core.eventbus.MessageConsumer<T> delegate) Create a new instance ofMessageConsumerdelegating to the given (non-null) instance ofMessageConsumer.MessageConsumer(io.vertx.core.eventbus.MessageConsumer<T> delegate, TypeArg<T> typeArg_0) MessageConsumer(Object delegate, TypeArg<T> typeArg_0) -
Method Summary
Modifier and TypeMethodDescriptionaddress()io.smallrye.mutiny.Uni<Void>Unlike the bare Vert.x variant, this method returns aUni.voidUnlike the bare Vert.x variant, this method returns aVoid.Unlike the bare Vert.x variant, this method ignores theVoidresult or any failure.endHandler(Runnable endHandler) Set an end handler.booleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.io.vertx.core.eventbus.MessageConsumer<T>Get the delegate instance.Set a data handler.inthashCode()booleanstatic <T> MessageConsumer<T>newInstance(io.vertx.core.eventbus.MessageConsumer<T> delegate) Creates a new instance of theMessageConsumer.static <T> MessageConsumer<T>newInstance(io.vertx.core.eventbus.MessageConsumer<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theMessageConsumer.pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.pipe()Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream.io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<Message<T>> arg0) Pipe thisReadStreamto theWriteStream.voidpipeToAndAwait(WriteStream<Message<T>> arg0) Pipe thisReadStreamto theWriteStream.pipeToAndForget(WriteStream<Message<T>> arg0) Pipe thisReadStreamto theWriteStream.resume()Resume reading, and sets the buffer inflowingmode.toMulti()toString()io.smallrye.mutiny.Uni<Void>Unregisters the handler which created this registrationvoidUnregisters the handler which created this registrationUnregisters the handler which created this registration
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
MessageConsumer
Create a new instance ofMessageConsumerdelegating to the given (non-null) instance ofMessageConsumer. -
MessageConsumer
-
MessageConsumer
-
-
Method Details
-
getDelegate
Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<T>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate instance
-
completion
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MessageConsumer.completion()
-
completionAndAwait
public void completionAndAwait()Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
MessageConsumer.completion()
-
completionAndForget
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MessageConsumer.completion()
-
unregister
Unregisters the handler which created this registrationUnlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MessageConsumer.unregister()
-
unregisterAndAwait
public void unregisterAndAwait()Unregisters the handler which created this registrationUnlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
MessageConsumer.unregister()
-
unregisterAndForget
Unregisters the handler which created this registrationUnlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MessageConsumer.unregister()
-
pipeTo
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
pipeToin interfaceReadStream<T>- Parameters:
dst- the destination write stream- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.core.eventbus.MessageConsumer#pipeTo(WriteStream)
-
pipeToAndAwait
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
dst- the destination write stream- See Also:
-
io.vertx.core.eventbus.MessageConsumer#pipeTo(WriteStream)
-
pipeToAndForget
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
dst- the destination write stream- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.core.eventbus.MessageConsumer#pipeTo(WriteStream)
-
exceptionHandler
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<T>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
handler
Description copied from interface:ReadStreamSet a data handler. As data is read, the handler will be called with the data.- Specified by:
handlerin interfaceReadStream<T>- Returns:
- a reference to this, so the API can be used fluently
-
pause
Description copied from interface:ReadStreamPause theReadStream, it sets the buffer infetchmode and clears the actual demand.While it's paused, no data will be sent to the data
handler.- Specified by:
pausein interfaceReadStream<T>- Returns:
- a reference to this, so the API can be used fluently
-
resume
Description copied from interface:ReadStreamResume reading, and sets the buffer inflowingmode. If theReadStreamhas been paused, reading will recommence on it.- Specified by:
resumein interfaceReadStream<T>- Returns:
- a reference to this, so the API can be used fluently
-
fetch
Description copied from interface:ReadStreamFetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<T>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Description copied from interface:ReadStreamSet an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandlerin interfaceReadStream<T>- Returns:
- a reference to this, so the API can be used fluently
-
bodyStream
- Returns:
- a read stream for the body of the message stream.
-
isRegistered
public boolean isRegistered()- Returns:
- true if the current consumer is registered
-
address
- Returns:
- The address the handler was registered with.
-
pipe
Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream. The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<T>- Returns:
- a pipe
-
newInstance
public static <T> MessageConsumer<T> newInstance(io.vertx.core.eventbus.MessageConsumer<T> delegate) Creates a new instance of theMessageConsumer. -
newInstance
public static <T> MessageConsumer<T> newInstance(io.vertx.core.eventbus.MessageConsumer<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theMessageConsumer. -
hashCode
public int hashCode() -
equals
-
toString
-
toMulti
-
toBlockingIterable
-
toBlockingStream
-