Package com.tick42.glue.core.interop.stream.publish

# 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

  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 specified `data` to subscribers accepted on specified `branches`.

  ### Methods inherited from interface com.tick42.glue.core.AsynchronousCloseable

  `close, closeAsync, onClose`

- ## Method Details

  - ### send

    <T> CompletionStage<?> send​(T data, String... branches)
    Send specified `data` to subscribers accepted on specified `branches`. 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 sent
      `branches` - 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