OLD | NEW |
1 library; | 1 library; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:isolate" as iso; | 4 import "dart:isolate" as iso; |
5 | 5 |
6 static field dynamic subscription = null; | 6 static field dynamic subscription = null; |
7 static method onData(dynamic x) → void { | 7 static method onData(dynamic x) → void { |
8 core::print(x); | 8 core::print(x); |
9 self::subscription.cancel(); | 9 self::subscription.cancel(); |
10 } | 10 } |
11 static method main() → dynamic { | 11 static method main() → dynamic { |
12 core::String string = core::String::fromCharCode(65); | 12 core::String string = core::String::fromCharCode(65); |
13 iso::ReceivePort port = iso::ReceivePort::•(); | 13 iso::ReceivePort port = iso::ReceivePort::•(); |
14 self::subscription = port.{iso::ReceivePort::listen}(self::onData); | 14 self::subscription = port.{iso::ReceivePort::listen}(self::onData); |
15 port.{iso::ReceivePort::sendPort}.{iso::SendPort::send}(string); | 15 port.{iso::ReceivePort::sendPort}.{iso::SendPort::send}(string); |
16 } | 16 } |
OLD | NEW |