Open alsemenov opened 7 years ago
You currently have to use addOnExitListener
to know that an isolate has terminated.
On the other hand, I see no problem in having the errors
stream do that for you - it's already an abstraction on top of the base functionality, so why not abstract over more.
It should be a non-breaking change, so I'll try implementing it.
The description for Isolate.errors reads:
Although it is not stated explicitly I would expect the
done
event in the errors stream, when the isolate instance terminates. The following code demonstrates the problem:Please, note that it does not output
errors stream is done
. The test just hangs after all work is done. To fix it it is necessary to addss1.cancel();
at the end of methodtest()
. This behavior seems to be not natural and not convenient - there is no easy way to detect that isolate has finished in order to unsubscribe from its errors stream.Dart VM version: 1.20.1 (Wed Oct 12 15:07:45 2016) on "windows_x64"