Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: tests/standalone/typed_data_isolate_test.dart

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/standalone/typed_data_isolate_test.dart
diff --git a/tests/standalone/typed_data_isolate_test.dart b/tests/standalone/typed_data_isolate_test.dart
index 852cc1e6153e6c9ed578a460ceadd1183c265ed2..37bf5471087bfbb47e45425a0fb7c1526797edc8 100644
--- a/tests/standalone/typed_data_isolate_test.dart
+++ b/tests/standalone/typed_data_isolate_test.dart
@@ -9,23 +9,25 @@ library TypedDataIsolateTest;
import 'dart:io';
import 'dart:isolate';
+import 'package:async_helper/async_helper.dart';
-second() {
- print('spawned');
- port.receive((data, replyTo) {
- print('got data');
- print(data);
- print('printed data');
- replyTo.send('OK');
- port.close();
- });
+second(message) {
+ var data = message[0];
+ var replyTo = message[1];
+ print('got data');
+ print(data);
+ print('printed data');
+ replyTo.send('OK');
}
main() {
+ asyncStart();
new File(Platform.script).readAsBytes().then((List<int> data) {
- spawnFunction(second).call(data).then((reply) {
+ var response = new ReceivePort();
+ var remote = Isolate.spawn(second, [data, response.sendPort]);
+ response.first.then((reply) {
print('got reply');
- port.close();
+ asyncEnd();
});
});
}
« no previous file with comments | « tests/standalone/typed_array_test.dart ('k') | tests/standalone/vmservice/isolate_stacktrace_command_script.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698