Interface StreamProducer
- All Superinterfaces:
AsynchronousCloseable,AutoCloseable,MethodRegistration
Stream data producer.
Used to broadcast data to subscribers.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionList all available branches on the stream.List<StreamConsumer<?>><T> CompletionStage<?>Send specifieddatato subscribers accepted on specifiedbranches.Methods inherited from interface com.tick42.glue.core.AsynchronousCloseable
close, closeAsync, onClose
-
Method Details
-
send
Send specifieddatato subscribers accepted on specifiedbranches. If no branches are specified data will be sent on the default branch.- Type Parameters:
T- type of the data- Parameters:
data- data to be sentbranches- stream branches on which data will be sent- Returns:
- a stage that will complete when data is sent, never
null
-
getBranches
Map<String,StreamBranch> getBranches()List all available branches on the stream. In addition, this allows to list all consumers for each branch.- Returns:
- a map with current stream branches
- Since:
- 1.3
-
getConsumers
List<StreamConsumer<?>> getConsumers()- Returns:
- list of consumers on the stream, regardless of branch. Never
null - Since:
- 1.3
-