Class AbstractEmitter<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.extension.AbstractEmitter<T>
-
- All Implemented Interfaces:
EmitterBehavior
- Direct Known Subclasses:
EmitterImpl,MutinyEmitterImpl
public abstract class AbstractEmitter<T> extends Object implements EmitterBehavior
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicReference<io.smallrye.mutiny.subscription.MultiEmitter<? super Message<? extends T>>>internalprotected Stringnameprotected io.smallrye.mutiny.Multi<Message<? extends T>>publisherprotected AtomicReference<Throwable>synchronousFailure
-
Constructor Summary
Constructors Constructor Description AbstractEmitter(EmitterConfiguration config, long defaultBufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete()Sends the completion event to the channel indicating that no other events will be sent afterward.protected voidemit(Message<? extends T> message)voiderror(Exception e)Sends a failure event to the channel.org.reactivestreams.Publisher<Message<? extends T>>getPublisher()booleanhasRequests()booleanisCancelled()
-
-
-
Field Detail
-
internal
protected final AtomicReference<io.smallrye.mutiny.subscription.MultiEmitter<? super Message<? extends T>>> internal
-
name
protected final String name
-
synchronousFailure
protected final AtomicReference<Throwable> synchronousFailure
-
-
Constructor Detail
-
AbstractEmitter
public AbstractEmitter(EmitterConfiguration config, long defaultBufferSize)
-
-
Method Detail
-
complete
public void complete()
Description copied from interface:EmitterBehaviorSends the completion event to the channel indicating that no other events will be sent afterward.- Specified by:
completein interfaceEmitterBehavior
-
error
public void error(Exception e)
Description copied from interface:EmitterBehaviorSends a failure event to the channel. No more events will be sent afterward.- Specified by:
errorin interfaceEmitterBehavior- Parameters:
e- the exception, must not benull
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceEmitterBehavior- Returns:
trueif the emitter has been terminated or the subscription cancelled.
-
hasRequests
public boolean hasRequests()
- Specified by:
hasRequestsin interfaceEmitterBehavior- Returns:
trueif one or more subscribers request messages from the corresponding channel where the emitter connects to, returnfalseotherwise.
-
-