addConsumer method

void addConsumer(
  1. Node consumer
)
inherited

Adds a consumer node to this stream.

Implementation

void addConsumer(Node consumer) {
  if (!_nodes.containsKey(consumer.uId)) {
    throw ArgumentError(
      'Consumer node with ID ${consumer.uId} is not part of this stream.',
    );
  }
  if (!isConsumer(consumer)) {
    _consumers.add(consumer.uId);
  }
}