Class EmitterImpl<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.extension.EmitterImpl<T>
-
-
Constructor Summary
Constructors Constructor Description EmitterImpl(String name, String overFlowStrategy, long bufferSize, long defaultBufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
Sends the completion event to the channel indicating that no other events will be sent afterward.void
error(Exception e)
Sends a failure event to the channel.org.reactivestreams.Publisher<Message<? extends T>>
getPublisher()
boolean
isCancelled()
boolean
isRequested()
<M extends Message<? extends T>>
voidsend(M msg)
Sends a payload to the channel.CompletionStage<Void>
send(T msg)
Sends a payload to the channel.
-
-
-
Method Detail
-
send
public CompletionStage<Void> send(T msg)
Description copied from interface:Emitter
Sends a payload to the channel.
-
send
public <M extends Message<? extends T>> void send(M msg)
Description copied from interface:Emitter
Sends a payload to the channel.
-
complete
public void complete()
Description copied from interface:Emitter
Sends 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:Emitter
Sends a failure event to the channel. No more events will be sent afterward.
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceEmitter<T>
- Returns:
true
if the emitter has been terminated or the subscription cancelled.
-
isRequested
public boolean isRequested()
- Specified by:
isRequested
in interfaceEmitter<T>
- Returns:
true
if the subscriber accepts messages,false
otherwise. UsingEmitter.send(Object)
on an emitter not expecting message would throw anIllegalStateException
.
-
-