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

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -