Class MutinyEmitterImpl<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.extension.AbstractEmitter<T>
-
- io.smallrye.reactive.messaging.extension.MutinyEmitterImpl<T>
-
- All Implemented Interfaces:
MutinyEmitter<T>
public class MutinyEmitterImpl<T> extends AbstractEmitter<T> implements MutinyEmitter<T>
-
-
Field Summary
-
Fields inherited from class io.smallrye.reactive.messaging.extension.AbstractEmitter
internal, name, NO_SUBSCRIBER_EXCEPTION, publisher, synchronousFailure
-
-
Constructor Summary
Constructors Constructor Description MutinyEmitterImpl(EmitterConfiguration config, long defaultBufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <M extends Message<? extends T>>
voidsend(M msg)Sends a message to the channel.io.smallrye.mutiny.Uni<Void>send(T payload)Sends a payload to the channel.voidsendAndAwait(T payload)Sends a payload to the channel.io.smallrye.mutiny.subscription.CancellablesendAndForget(T payload)Sends a payload to the channel without waiting for acknowledgement.-
Methods inherited from class io.smallrye.reactive.messaging.extension.AbstractEmitter
complete, emit, error, getPublisher, hasRequests, isCancelled, verify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.messaging.MutinyEmitter
complete, error, hasRequests, isCancelled
-
-
-
-
Constructor Detail
-
MutinyEmitterImpl
public MutinyEmitterImpl(EmitterConfiguration config, long defaultBufferSize)
-
-
Method Detail
-
send
public io.smallrye.mutiny.Uni<Void> send(T payload)
Description copied from interface:MutinyEmitterSends a payload to the channel.A
Messageobject will be created to hold the payload and the returnedUnican be subscribed to for triggering the send. When subscribed, anullitem will be passed to theUniwhen theMessageis acknowledged. If theMessageis never acknowledged, then theUniwill never be completed.The
Messagewill not be sent to the channel until theUnihas been subscribed to:emitter.send("a").subscribe().with(x -> { });- Specified by:
sendin interfaceMutinyEmitter<T>- Parameters:
payload- the thing to send, must not benull- Returns:
- the
Uni, that requires subscription to send theMessage.
-
sendAndAwait
public void sendAndAwait(T payload)
Description copied from interface:MutinyEmitterSends a payload to the channel.A
Messageobject will be created to hold the payload.Execution will block waiting for the resulting
Messageto be acknowledged before returning.- Specified by:
sendAndAwaitin interfaceMutinyEmitter<T>- Parameters:
payload- the thing to send, must not benull
-
sendAndForget
public io.smallrye.mutiny.subscription.Cancellable sendAndForget(T payload)
Description copied from interface:MutinyEmitterSends a payload to the channel without waiting for acknowledgement.A
Messageobject will be created to hold the payload.- Specified by:
sendAndForgetin interfaceMutinyEmitter<T>- Parameters:
payload- the thing to send, must not benull- Returns:
- the
Cancellablefrom the subscribedUni.
-
send
public <M extends Message<? extends T>> void send(M msg)
Description copied from interface:MutinyEmitterSends a message to the channel.- Specified by:
sendin interfaceMutinyEmitter<T>- Type Parameters:
M- the Message type- Parameters:
msg- the Message to send, must not benull
-
-