public class MutinyEmitterImpl<T> extends AbstractEmitter<T> implements MutinyEmitter<T>
internal, name, publisher, synchronousFailure
Constructor and Description |
---|
MutinyEmitterImpl(EmitterConfiguration config,
long defaultBufferSize) |
Modifier and Type | Method and Description |
---|---|
<M extends Message<? extends T>> |
send(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.
|
complete, emit, error, getPublisher, hasRequests, isCancelled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, error, hasRequests, isCancelled
public MutinyEmitterImpl(EmitterConfiguration config, long defaultBufferSize)
public io.smallrye.mutiny.Uni<Void> send(T payload)
MutinyEmitter
A Message
object will be created to hold the payload and the returned Uni
can be subscribed to for triggering the send.
When subscribed, a null
item will be passed to the Uni
when the
Message
is acknowledged. If the Message
is never acknowledged, then the Uni
will
never be completed.
The Message
will not be sent to the channel until the Uni
has been subscribed to:
emitter.send("a").subscribe().with(x -> { });
send
in interface MutinyEmitter<T>
payload
- the thing to send, must not be null
Uni
, that requires subscription to send the Message
.public void sendAndAwait(T payload)
MutinyEmitter
A Message
object will be created to hold the payload.
Execution will block waiting for the resulting Message
to be acknowledged before returning.
sendAndAwait
in interface MutinyEmitter<T>
payload
- the thing to send, must not be null
public io.smallrye.mutiny.subscription.Cancellable sendAndForget(T payload)
MutinyEmitter
A Message
object will be created to hold the payload.
sendAndForget
in interface MutinyEmitter<T>
payload
- the thing to send, must not be null
Cancellable
from the subscribed Uni
.public <M extends Message<? extends T>> void send(M msg)
MutinyEmitter
send
in interface MutinyEmitter<T>
M
- the Message typemsg
- the Message to send, must not be null
Copyright © 2018–2021 SmallRye. All rights reserved.