Class MutinyEmitterImpl<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.providers.extension.AbstractEmitter<T>
-
- io.smallrye.reactive.messaging.providers.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.providers.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.void
sendAndAwait(T payload)
Sends a payload to the channel.io.smallrye.mutiny.subscription.Cancellable
sendAndForget(T payload)
Sends a payload to the channel without waiting for acknowledgement.-
Methods inherited from class io.smallrye.reactive.messaging.providers.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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> send(T payload)
Description copied from interface:MutinyEmitter
Sends a payload to the channel.A
Message
object will be created to hold the payload and the returnedUni
can be subscribed to for triggering the send. When subscribed, anull
item will be passed to theUni
when theMessage
is acknowledged. If theMessage
is never acknowledged, then theUni
will never be completed.The
Message
will not be sent to the channel until theUni
has been subscribed to:emitter.send("a").subscribe().with(x -> { });
- Specified by:
send
in 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:MutinyEmitter
Sends a payload to the channel.A
Message
object will be created to hold the payload.Execution will block waiting for the resulting
Message
to be acknowledged before returning.- Specified by:
sendAndAwait
in 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:MutinyEmitter
Sends a payload to the channel without waiting for acknowledgement.A
Message
object will be created to hold the payload.- Specified by:
sendAndForget
in interfaceMutinyEmitter<T>
- Parameters:
payload
- the thing to send, must not benull
- Returns:
- the
Cancellable
from the subscribedUni
.
-
send
public <M extends Message<? extends T>> void send(M msg)
Description copied from interface:MutinyEmitter
Sends a message to the channel.- Specified by:
send
in interfaceMutinyEmitter<T>
- Type Parameters:
M
- the Message type- Parameters:
msg
- the Message to send, must not benull
-
-