Skip to content

Instantly share code, notes, and snippets.

@tunitowen
Created September 2, 2025 12:27
Show Gist options
  • Select an option

  • Save tunitowen/29964ff1fe13bc56d08c7d6ae1627533 to your computer and use it in GitHub Desktop.

Select an option

Save tunitowen/29964ff1fe13bc56d08c7d6ae1627533 to your computer and use it in GitHub Desktop.
Joii Isolate
import 'dart:isolate';
import 'package:flutter/foundation.dart';
void main() async {
final receivePort = ReceivePort();
receivePort.listen((value) {
print("V: $value");
});
Isolate.spawn(doThing, receivePort.sendPort);
}
void doThing(SendPort sendPort) {
final list = List.generate(100000, (e) => e);
for (final v in list) {
print(v);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment