Interface StreamProducer
-
- All Superinterfaces:
AsynchronousCloseable,AutoCloseable,MethodRegistration
public interface StreamProducer extends MethodRegistration
Stream data producer. Used to broadcast data to subscribers.- See Also:
StreamConsumer.send(Object)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,StreamBranch>getBranches()List all available branches on the stream.List<StreamConsumer<?>>getConsumers()<T> CompletionStage<?>send(T data, String... branches)Send specifieddatato subscribers accepted on specifiedbranches.-
Methods inherited from interface com.tick42.glue.core.AsynchronousCloseable
close, closeAsync, onClose
-
-
-
-
Method Detail
-
send
<T> CompletionStage<?> send(T data, String... branches)
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
-
-