dart - Cancel stdin subscription in combination with LineSplitter -
i use linesplitter
command line interface every line command:
import "dart:io"; import 'dart:convert'; void main() { var sub; sub = stdin.transform(utf8.decoder).transform(new linesplitter()).listen((l) { if (l == "e") { sub.cancel(); } print('$l'); }); }
typing e
, line break should exit application subscribtion canceled. doesn't happen, instead have put line break stdin. problem seems linesplitter
, maybe it's waiting next complete line, there way "undo"/"unchain" transformer application exits?
calling exit
not option me exits without correct cleanup.
i think this question related, isn't solved.
this issue io library in dart sdk on windows , bug should fixed (see https://github.com/dart-lang/sdk/issues/22940)
Comments
Post a Comment