T - type of payload or Message.public interface Emitter<T>
Instances are injected using:
@Inject
@Stream("my-stream")
Emitter<String> emitter;
You can inject emitter sending payload or Messages.
The name of the stream (given in the Stream annotation) indicates which streams is fed. If must match the name
used in a
method using @Incoming or an outgoing stream configured in the
application configuration.
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Completes the stream.
|
void |
error(Exception e)
Propagates an error in the stream.
|
boolean |
isCancelled() |
boolean |
isRequested() |
Emitter<T> |
send(T msg)
Sends a payload or a message to the stream.
|
Emitter<T> send(T msg)
msg - the thing to send, must not be nullIllegalStateException - if the stream does not have any pending requests, or if the stream has been
cancelled or terminated.void complete()
void error(Exception e)
e - the exception, must not be nullboolean isCancelled()
true if the emitter has been terminated or the subscription cancelled.boolean isRequested()
true if the subscriber accepts messages, false otherwise.
Using send(Object) on an emitter not expecting message would throw an IllegalStateException.Copyright © 2018–2019 SmallRye. All rights reserved.