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

Side by Side Diff: tests/isolate/src/MandelIsolateTest.dart

Issue 9652001: SendPort + ReceivePort changes: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/isolate/src/IsolateNegativeTest.dart ('k') | tests/isolate/src/Message2Test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('MandelIsolateTest'); 5 #library('MandelIsolateTest');
6 #import('dart:isolate'); 6 #import('dart:isolate');
7 #import('TestFramework.dart'); 7 #import('TestFramework.dart');
8 8
9 final TERMINATION_MESSAGE = -1; 9 final TERMINATION_MESSAGE = -1;
10 final N = 100; 10 final N = 100;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 82
83 class LineProcessorClient { 83 class LineProcessorClient {
84 84
85 LineProcessorClient(MandelbrotState this._state, int this._id) { 85 LineProcessorClient(MandelbrotState this._state, int this._id) {
86 _out = new LineProcessor().spawn(); 86 _out = new LineProcessor().spawn();
87 } 87 }
88 88
89 void processLine(int y) { 89 void processLine(int y) {
90 _out.then((SendPort p) { 90 _out.then((SendPort p) {
91 p.call(y).receive((List<int> message, SendPort replyTo) { 91 p.call(y).then((List<int> message) {
92 _state.notifyProcessedLine(this, y, message); 92 _state.notifyProcessedLine(this, y, message);
93 }); 93 });
94 }); 94 });
95 } 95 }
96 96
97 void shutdown() { 97 void shutdown() {
98 _out.then((SendPort p) { 98 _out.then((SendPort p) {
99 p.send(TERMINATION_MESSAGE, null); 99 p.send(TERMINATION_MESSAGE, null);
100 }); 100 });
101 } 101 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 result[x] = i; 147 result[x] = i;
148 } 148 }
149 return result; 149 return result;
150 } 150 }
151 151
152 } 152 }
153 153
154 main() { 154 main() {
155 runTests([test]); 155 runTests([test]);
156 } 156 }
OLDNEW
« no previous file with comments | « tests/isolate/src/IsolateNegativeTest.dart ('k') | tests/isolate/src/Message2Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698