disconnect method

Future disconnect ()

Disconnects all channels that have been transformed.

Returns a future that completes when all inner sinks' StreamSink.close futures have completed. Note that a StreamController's sink won't close until the corresponding stream has a listener.

Implementation

Future disconnect() => _disconnectMemo.runOnce(() {
      var futures = _sinks.map((sink) => sink._disconnect()).toList();
      _sinks.clear();
      return Future.wait(futures, eagerError: true);
    });