47fbe76d03
Change-Id: Id45696a38b281b1b75a9a0e26d89216388a4ec19 Reviewed-on: https://dart-review.googlesource.com/39942 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
17 lines
428 B
Plaintext
17 lines
428 B
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "dart:isolate" as iso;
|
|
|
|
static field dynamic subscription;
|
|
static method onData(dynamic x) → void {
|
|
core::print(x);
|
|
self::subscription.cancel();
|
|
}
|
|
static method main() → dynamic {
|
|
dynamic string = core::String::fromCharCode(65);
|
|
dynamic port = iso::ReceivePort::•();
|
|
self::subscription = port.listen(self::onData);
|
|
port.sendPort.send(string);
|
|
}
|