| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 * the isolate will act as if, respectively, [setErrorsFatal], | 150 * the isolate will act as if, respectively, [setErrorsFatal], |
| 151 * [addOnExitListener] and [addErrorListener] were called with the | 151 * [addOnExitListener] and [addErrorListener] were called with the |
| 152 * corresponding parameter and was processed before the isolate starts | 152 * corresponding parameter and was processed before the isolate starts |
| 153 * running. | 153 * running. |
| 154 * | 154 * |
| 155 * You can also call the [setErrorsFatal], [addOnExitListener] and | 155 * You can also call the [setErrorsFatal], [addOnExitListener] and |
| 156 * [addErrorListener] methods on the returned isolate, but unless the | 156 * [addErrorListener] methods on the returned isolate, but unless the |
| 157 * isolate was started as [paused], it may already have terminated | 157 * isolate was started as [paused], it may already have terminated |
| 158 * before those methods can complete. | 158 * before those methods can complete. |
| 159 * | 159 * |
| 160 * WARNING: The [errorsAreFatal], [onExit] and [onError] parameters are not | |
| 161 * implemented yet. | |
| 162 * | |
| 163 * Returns a future that will complete with an [Isolate] instance if the | 160 * Returns a future that will complete with an [Isolate] instance if the |
| 164 * spawning succeeded. It will complete with an error otherwise. | 161 * spawning succeeded. It will complete with an error otherwise. |
| 165 */ | 162 */ |
| 166 external static Future<Isolate> spawn(void entryPoint(message), var message, | 163 external static Future<Isolate> spawn(void entryPoint(message), var message, |
| 167 { bool paused: false, | 164 { bool paused: false, |
| 168 bool errorsAreFatal, | 165 bool errorsAreFatal, |
| 169 SendPort onExit, | 166 SendPort onExit, |
| 170 SendPort onError }); | 167 SendPort onError }); |
| 171 | 168 |
| 172 /** | 169 /** |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 * as the original error, but has no other features of the original error. | 635 * as the original error, but has no other features of the original error. |
| 639 */ | 636 */ |
| 640 class RemoteError implements Error { | 637 class RemoteError implements Error { |
| 641 final String _description; | 638 final String _description; |
| 642 final StackTrace stackTrace; | 639 final StackTrace stackTrace; |
| 643 RemoteError(String description, String stackDescription) | 640 RemoteError(String description, String stackDescription) |
| 644 : _description = description, | 641 : _description = description, |
| 645 stackTrace = new StackTrace.fromString(stackDescription); | 642 stackTrace = new StackTrace.fromString(stackDescription); |
| 646 String toString() => _description; | 643 String toString() => _description; |
| 647 } | 644 } |
| OLD | NEW |