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

Unified Diff: samples/sample_extension/sample_asynchronous_extension.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
« no previous file with comments | « samples/chat/test/chat_server_test.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/sample_extension/sample_asynchronous_extension.dart
diff --git a/samples/sample_extension/sample_asynchronous_extension.dart b/samples/sample_extension/sample_asynchronous_extension.dart
index 3459b440aa997ca6642a1b52f021ae6e5da04402..c93d628ab07b1d4bc2c008dc7b880048884c1a12 100644
--- a/samples/sample_extension/sample_asynchronous_extension.dart
+++ b/samples/sample_extension/sample_asynchronous_extension.dart
@@ -12,11 +12,14 @@ import 'dart-ext:sample_extension';
class RandomArray {
static SendPort _port;
- Future<List<int> > randomArray(int seed, int length) {
+ Future<List<int>> randomArray(int seed, int length) {
var args = new List(2);
args[0] = seed;
args[1] = length;
- return _servicePort.call(args).then((result) {
+ ReceivePort receivePort = new ReceivePort();
+ _servicePort.send(args, receivePort.sendPort);
+ return receivePort.first.then((result) {
+ receivePort.close();
if (result != null) {
return result;
} else {
« no previous file with comments | « samples/chat/test/chat_server_test.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698