StreamResponseCleaner constructor

StreamResponseCleaner({
  1. required Set<String> trackingSet,
  2. required List<Stream<Nip01Event>> inputStreams,
  3. required StreamController<Nip01Event> outController,
  4. required int? timeout,
})
  • trackingSet a set of ids that are already returned \
  • inputStreams a list of streams that are be listened to \
  • outController the controller that is used to add the events to \
  • timeout the timeout for the stream, if null RequestDefaults.DEFAULT_STREAM_IDLE_TIMEOUT is used

Implementation

StreamResponseCleaner({
  required this.trackingSet,
  required this.inputStreams,
  required this.outController,
  required this.timeout,
}) {
  if (timeout != null) {
    Future.delayed(
        Duration(
          seconds: timeout!,
        ), () {
      if (!outController.isClosed) {
        outController.close();
      }
    });
  }
}