OLD | NEW |
1 // 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 |
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 class IsolateSpawnException implements Exception { | 5 class IsolateSpawnException implements Exception { |
6 const IsolateSpawnException(String this._s); | 6 const IsolateSpawnException(String this._s); |
7 String toString() => "IsolateSpawnException: '$_s'"; | 7 String toString() => "IsolateSpawnException: '$_s'"; |
8 final String _s; | 8 final String _s; |
9 } | 9 } |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 * the receiver to facilitate exchanging sequences of messages. | 62 * the receiver to facilitate exchanging sequences of messages. |
63 * | 63 * |
64 * The content of [message] can be: primitive values (null, num, bool, double, | 64 * The content of [message] can be: primitive values (null, num, bool, double, |
65 * String), instances of [SendPort], and lists and maps whose elements are any | 65 * String), instances of [SendPort], and lists and maps whose elements are any |
66 * of these. List and maps are also allowed to be cyclic. | 66 * of these. List and maps are also allowed to be cyclic. |
67 * | 67 * |
68 * In the special circumstances when two isolates share the same code and are | 68 * In the special circumstances when two isolates share the same code and are |
69 * running in the same process (e.g. isolates created via [spawnFunction]), it | 69 * running in the same process (e.g. isolates created via [spawnFunction]), it |
70 * is also possible to send object instances (which would be copied in the | 70 * is also possible to send object instances (which would be copied in the |
71 * process). This is currently only supported by the dartvm. For now, the | 71 * process). This is currently only supported by the dartvm. For now, the |
72 * frog compiler only supports the restricted messages described above. | 72 * dart2js compiler only supports the restricted messages described above. |
73 * | 73 * |
74 * Deprecation note: it is no longer valid to transmit a [ReceivePort] in a | 74 * Deprecation note: it is no longer valid to transmit a [ReceivePort] in a |
75 * message. Previously they were translated to the corresponding send port | 75 * message. Previously they were translated to the corresponding send port |
76 * before being transmitted. | 76 * before being transmitted. |
77 */ | 77 */ |
78 void send(var message, [SendPort replyTo]); | 78 void send(var message, [SendPort replyTo]); |
79 | 79 |
80 /** | 80 /** |
81 * Sends a message to this send port and returns a [Future] of the reply. | 81 * Sends a message to this send port and returns a [Future] of the reply. |
82 * Basically, this internally creates a new receive port, sends a | 82 * Basically, this internally creates a new receive port, sends a |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 SendPort toSendPort(); | 139 SendPort toSendPort(); |
140 | 140 |
141 } | 141 } |
142 | 142 |
143 // TODO(kasperl): Make this hashable and document it. | 143 // TODO(kasperl): Make this hashable and document it. |
144 interface SendPortSync { | 144 interface SendPortSync { |
145 | 145 |
146 callSync(var message); | 146 callSync(var message); |
147 | 147 |
148 } | 148 } |
OLD | NEW |