Dart program not exiting

Issue I’m having trouble tracking down why my dart program isn’t terminating. I’m pretty sure it’s something to do with either isolates, or stream controllers, and making sure they are closed, but I can’t work out what the problem is.

Continue reading

How to pass arguments (besides SendPort) to a spawned isolate in Dart

Issue In this article, they spawned an isolate like this: import ‘dart:isolate’; void main() async { final receivePort = ReceivePort(); final isolate = await Isolate.spawn( downloadAndCompressTheInternet, receivePort.sendPort, ); receivePort.listen((message) { print(message); receivePort.close(); isolate.kill(); }); } void downloadAndCompressTheInternet(SendPort sendPort) { sendPort.send(42);

Continue reading