Created
August 16, 2017 14:33
-
-
Save selvan/35c4dab2bf03f8b4d82b0ccb11699205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
https://stackoverflow.com/questions/45716994/isolate-code-didnt-work-as-expected