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 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
hasRequests()
boolean
isCancelled()
<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:Emitter
Sends a payload to the channel.A
Message
object will be created to hold the payload and the returnedCompletionStage
will be completed once thisMessage
is acknowledged. If theMessage
is never acknowledged, then theCompletionStage
will never be completed.
-
send
public <M extends Message<? extends T>> void send(M msg)
Description copied from interface:Emitter
Sends a message 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.
-
hasRequests
public boolean hasRequests()
- Specified by:
hasRequests
in interfaceEmitter<T>
- Returns:
true
if one or more subscribers request messages from the corresponding channel where the emitter connects to, returnfalse
otherwise.
-
-