Class EmitterImpl<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.extension.EmitterImpl<T>
-
-
Constructor Summary
Constructors Constructor Description EmitterImpl(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.voiderror(Exception e)Sends a failure event to the channel.org.reactivestreams.Publisher<Message<? extends T>>getPublisher()booleanhasRequests()booleanisCancelled()<M extends Message<? extends T>>
voidsend(M msg)Sends a message to the channel.CompletionStage<Void>send(T msg)Sends a payload to the channel.
-
-
-
Constructor Detail
-
EmitterImpl
public EmitterImpl(EmitterConfiguration config, long defaultBufferSize)
-
-
Method Detail
-
send
public CompletionStage<Void> send(T msg)
Description copied from interface:EmitterSends a payload to the channel.A
Messageobject will be created to hold the payload and the returnedCompletionStagewill be completed once thisMessageis acknowledged. If theMessageis never acknowledged, then theCompletionStagewill never be completed.
-
send
public <M extends Message<? extends T>> void send(M msg)
Description copied from interface:EmitterSends a message to the channel.
-
complete
public void complete()
Description copied from interface:EmitterSends the completion event to the channel indicating that no other events will be sent afterward.
-
error
public void error(Exception e)
Description copied from interface:EmitterSends a failure event to the channel. No more events will be sent afterward.
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceEmitter<T>- Returns:
trueif the emitter has been terminated or the subscription cancelled.
-
hasRequests
public boolean hasRequests()
- Specified by:
hasRequestsin interfaceEmitter<T>- Returns:
trueif one or more subscribers request messages from the corresponding channel where the emitter connects to, returnfalseotherwise.
-
-