Class ContextualEmitterImpl<T>
java.lang.Object
io.smallrye.reactive.messaging.providers.extension.AbstractEmitter<T>
io.quarkus.smallrye.reactivemessaging.runtime.ContextualEmitterImpl<T>
- All Implemented Interfaces:
ContextualEmitter<T>,io.smallrye.reactive.messaging.EmitterType,io.smallrye.reactive.messaging.MessagePublisherProvider<T>
public class ContextualEmitterImpl<T>
extends io.smallrye.reactive.messaging.providers.extension.AbstractEmitter<T>
implements ContextualEmitter<T>
-
Field Summary
Fields inherited from class io.smallrye.reactive.messaging.providers.extension.AbstractEmitter
internal, name, NO_SUBSCRIBER_EXCEPTION, publisher, synchronousFailure -
Constructor Summary
ConstructorsConstructorDescriptionContextualEmitterImpl(io.smallrye.reactive.messaging.EmitterConfiguration configuration, long defaultBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> io.smallrye.mutiny.Uni<T> io.smallrye.mutiny.Uni<Void> 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.<M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>>
io.smallrye.mutiny.Uni<Void> sendMessage(M msg) Sends a message to the channel.<M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>>
voidsendMessageAndAwait(M msg) Sends a message to the channel.<M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>>
io.smallrye.mutiny.subscription.CancellablesendMessageAndForget(M msg) Sends a message to the channel without waiting for acknowledgement.static <T,R> io.smallrye.mutiny.Uni <R> transformToUni(io.smallrye.mutiny.Uni<T> upstream, Function<? super T, io.smallrye.mutiny.Uni<? extends R>> mapper) Methods inherited from class io.smallrye.reactive.messaging.providers.extension.AbstractEmitter
complete, emit, error, getPublisher, hasRequests, isCancelled, verifyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.smallrye.reactivemessaging.runtime.ContextualEmitter
complete, error, hasRequests, isCancelled
-
Constructor Details
-
ContextualEmitterImpl
public ContextualEmitterImpl(io.smallrye.reactive.messaging.EmitterConfiguration configuration, long defaultBufferSize)
-
-
Method Details
-
sendAndAwait
Description copied from interface:ContextualEmitterSends 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 interfaceContextualEmitter<T>- Parameters:
payload- the thing to send, must not benull
-
sendAndForget
Description copied from interface:ContextualEmitterSends a payload to the channel without waiting for acknowledgement.A
Messageobject will be created to hold the payload.- Specified by:
sendAndForgetin interfaceContextualEmitter<T>- Parameters:
payload- the thing to send, must not benull- Returns:
- the
Cancellablefrom the subscribedUni.
-
send
Description copied from interface:ContextualEmitterSends 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 interfaceContextualEmitter<T>- Parameters:
payload- the thing to send, must not benull- Returns:
- the
Uni, that requires subscription to send theMessage.
-
sendMessageAndAwait
public <M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>> void sendMessageAndAwait(M msg) Description copied from interface:ContextualEmitterSends a message to the channel. Execution will block waiting for the resultingMessageto be acknowledged before returning.- Specified by:
sendMessageAndAwaitin interfaceContextualEmitter<T>- Type Parameters:
M- the Message type- Parameters:
msg- the Message to send, must not benull
-
sendMessageAndForget
public <M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>> io.smallrye.mutiny.subscription.Cancellable sendMessageAndForget(M msg) Description copied from interface:ContextualEmitterSends a message to the channel without waiting for acknowledgement.- Specified by:
sendMessageAndForgetin interfaceContextualEmitter<T>- Type Parameters:
M- the Message type- Parameters:
msg- the Message to send, must not benull- Returns:
- the
Cancellablefrom the subscribedUni.
-
sendMessage
@CheckReturnValue public <M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>> io.smallrye.mutiny.Uni<Void> sendMessage(M msg) Description copied from interface:ContextualEmitterSends a message to the channel.- Specified by:
sendMessagein interfaceContextualEmitter<T>- Type Parameters:
M- the Message type- Parameters:
msg- the Message to send, must not benull- Returns:
- the
Uni, that requires subscription to send theMessage.
-
emitter
public static <T> io.smallrye.mutiny.Uni<T> emitter(Consumer<io.smallrye.mutiny.subscription.UniEmitter<? super T>> emitter) -
transformToUni
public static <T,R> io.smallrye.mutiny.Uni<R> transformToUni(io.smallrye.mutiny.Uni<T> upstream, Function<? super T, io.smallrye.mutiny.Uni<? extends R>> mapper)
-