OLD | NEW |
1 | |
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 // 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 |
4 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
5 | 4 |
6 library sibling_isolate; | 5 library http_lanuch_main; |
7 | 6 |
8 import 'package:shared.dart'as shared; | |
9 import 'dart:isolate'; | 7 import 'dart:isolate'; |
| 8 import 'dart:io'; |
10 | 9 |
11 // This file is spawned from package_isolate_test.dart | |
12 main() { | 10 main() { |
13 shared.output = 'isolate'; | 11 int port = int.parse(new Options().arguments[0]); |
14 port.receive((msg, replyTo) { | 12 SendPort spawnedPort = spawnUri('http://127.0.0.1:$port/http_isolate_main.dart
'); |
15 replyTo.send(shared.output); | 13 spawnedPort.call('hello').then((response) { |
| 14 print(response); |
16 }); | 15 }); |
17 } | 16 } |
| 17 |
OLD | NEW |