remove method

Future remove (Stream<T> stream)

Removes stream as a member of this group.

No further events from stream will be emitted through this group. If stream has been listened to, its subscription will be canceled.

If stream has been listened to, this synchronously cancels its subscription. This means that any events from stream that haven't yet been emitted through this group will not be.

If stream's subscription is canceled, this returns StreamSubscription.cancel's return value. Otherwise, it returns null.

Implementation

Future remove(Stream<T> stream) {
  var subscription = _subscriptions.remove(stream);
  var future = subscription == null ? null : subscription.cancel();
  if (_closed && _subscriptions.isEmpty) _controller.close();
  return future;
}