StreamResponseCleaner constructor
StreamResponseCleaner({
- required Set<
String> trackingSet, - required List<
Stream< inputStreams,Nip01Event> > - required StreamController<
Nip01Event> outController, - 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();
}
});
}
}