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 /** | 5 /** |
6 * Concurrent programming using _isolates_: | 6 * Concurrent programming using _isolates_: |
7 * independent workers that are similar to threads | 7 * independent workers that are similar to threads |
8 * but don't share memory, | 8 * but don't share memory, |
9 * communicating only via messages. | 9 * communicating only via messages. |
10 */ | 10 */ |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 * WARNING: The [packageRoot] parameter is not implemented on all | 187 * WARNING: The [packageRoot] parameter is not implemented on all |
188 * platforms yet. | 188 * platforms yet. |
189 * | 189 * |
190 * If the [paused] parameter is set to `true`, | 190 * If the [paused] parameter is set to `true`, |
191 * the isolate will start up in a paused state, | 191 * the isolate will start up in a paused state, |
192 * as if by an initial call of `isolate.pause(isolate.pauseCapability)`. | 192 * as if by an initial call of `isolate.pause(isolate.pauseCapability)`. |
193 * This allows setting up error or exit listeners on the isolate | 193 * This allows setting up error or exit listeners on the isolate |
194 * before it starts running. | 194 * before it starts running. |
195 * To resume the isolate, call `isolate.resume(isolate.pauseCapability)`. | 195 * To resume the isolate, call `isolate.resume(isolate.pauseCapability)`. |
196 * | 196 * |
197 * WARNING: The `pause` parameter is not implemented on all platforms yet. | 197 * If the [checked] parameter is set to `true` or `false`, |
198 * the new isolate will run code in checked mode, | |
199 * respectively in production mode, if possible. | |
200 * If the parameter is omitted, it defaults to `true` | |
201 * if the current isolate is running in checked mode | |
202 * and `false` otherwise. | |
Ivan Posva
2015/05/29 15:18:17
You could also say that it inherits the checked mo
Lasse Reichstein Nielsen
2015/06/02 15:26:44
Done.
| |
203 * | |
204 * If the isolate code was pre-compiled, it may not be possible to change | |
205 * the checked mode setting dynamically. | |
206 * | |
207 * WARNING: The [checked] parameter is not implemented on all platforms yet. | |
198 * | 208 * |
199 * Returns a future that will complete with an [Isolate] instance if the | 209 * Returns a future that will complete with an [Isolate] instance if the |
200 * spawning succeeded. It will complete with an error otherwise. | 210 * spawning succeeded. It will complete with an error otherwise. |
201 */ | 211 */ |
202 external static Future<Isolate> spawnUri( | 212 external static Future<Isolate> spawnUri( |
203 Uri uri, | 213 Uri uri, |
204 List<String> args, | 214 List<String> args, |
205 var message, | 215 var message, |
206 {bool paused: false, | 216 {bool paused: false, |
217 bool checked, | |
207 Uri packageRoot}); | 218 Uri packageRoot}); |
Ivan Posva
2015/05/29 15:18:17
The order in the function signature and in the doc
Lasse Reichstein Nielsen
2015/06/02 15:26:44
Done.
| |
208 | 219 |
209 /** | 220 /** |
210 * Requests the isolate to pause. | 221 * Requests the isolate to pause. |
211 * | 222 * |
212 * The isolate should stop handling events by pausing its event queue. | 223 * The isolate should stop handling events by pausing its event queue. |
213 * The request will eventually make the isolate stop doing anything. | 224 * The request will eventually make the isolate stop doing anything. |
214 * It will be handled before any other messages that are later sent to the | 225 * It will be handled before any other messages that are later sent to the |
215 * isolate from the current isolate, but no other guarantees are provided. | 226 * isolate from the current isolate, but no other guarantees are provided. |
216 * | 227 * |
217 * The event loop may be paused before previously sent, but not yet exeuted, | 228 * The event loop may be paused before previously sent, but not yet exeuted, |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
580 * as the original error, but has no other features of the original error. | 591 * as the original error, but has no other features of the original error. |
581 */ | 592 */ |
582 class RemoteError implements Error { | 593 class RemoteError implements Error { |
583 final String _description; | 594 final String _description; |
584 final StackTrace stackTrace; | 595 final StackTrace stackTrace; |
585 RemoteError(String description, String stackDescription) | 596 RemoteError(String description, String stackDescription) |
586 : _description = description, | 597 : _description = description, |
587 stackTrace = new StackTrace.fromString(stackDescription); | 598 stackTrace = new StackTrace.fromString(stackDescription); |
588 String toString() => _description; | 599 String toString() => _description; |
589 } | 600 } |
OLD | NEW |