Skip to content

Instantly share code, notes, and snippets.

@selvan
Created August 16, 2017 14:33
Show Gist options
  • Save selvan/35c4dab2bf03f8b4d82b0ccb11699205 to your computer and use it in GitHub Desktop.
Save selvan/35c4dab2bf03f8b4d82b0ccb11699205 to your computer and use it in GitHub Desktop.
import 'dart:async';
import 'dart:isolate';
var mainReceivePort = new ReceivePort();
main() async {
await Isolate.spawn(hello, null);
await for (var msg in mainReceivePort) {
print(msg);
return;
}
}
hello(_) async {
var sendPort = mainReceivePort.sendPort;
sendPort.send("Hello world");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment