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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 * | 519 * |
520 * Since isolates run concurrently, it's possible for it to exit before the | 520 * Since isolates run concurrently, it's possible for it to exit before the |
521 * error listener is established. To avoid this, start the isolate paused, | 521 * error listener is established. To avoid this, start the isolate paused, |
522 * add the listener and then resume the isolate. | 522 * add the listener and then resume the isolate. |
523 */ | 523 */ |
524 external void addErrorListener(SendPort port); | 524 external void addErrorListener(SendPort port); |
525 | 525 |
526 /** | 526 /** |
527 * Stops listening for uncaught errors from the isolate. | 527 * Stops listening for uncaught errors from the isolate. |
528 * | 528 * |
529 * Requests for the isolate to not send uncaught errors on [responsePort]. | 529 * Requests for the isolate to not send uncaught errors on [port]. |
530 * If the isolate isn't expecting to send uncaught errors on [responsePort], | 530 * If the isolate isn't expecting to send uncaught errors on [port], |
531 * because the port hasn't been added using [addErrorListener], | 531 * because the port hasn't been added using [addErrorListener], |
532 * or because it has already been removed, the request is ignored. | 532 * or because it has already been removed, the request is ignored. |
533 * | 533 * |
534 * If the same port has been passed via [addErrorListener] more than once, | 534 * If the same port has been passed via [addErrorListener] more than once, |
535 * only one call to `removeErrorListener` is needed to stop it from receiving | 535 * only one call to `removeErrorListener` is needed to stop it from receiving |
536 * unaught errors. | 536 * unaught errors. |
537 * | 537 * |
538 * Uncaught errors message may still be sent by the isolate | 538 * Uncaught errors message may still be sent by the isolate |
539 * until this request is received and processed. | 539 * until this request is received and processed. |
540 */ | 540 */ |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 * as the original error, but has no other features of the original error. | 721 * as the original error, but has no other features of the original error. |
722 */ | 722 */ |
723 class RemoteError implements Error { | 723 class RemoteError implements Error { |
724 final String _description; | 724 final String _description; |
725 final StackTrace stackTrace; | 725 final StackTrace stackTrace; |
726 RemoteError(String description, String stackDescription) | 726 RemoteError(String description, String stackDescription) |
727 : _description = description, | 727 : _description = description, |
728 stackTrace = new StackTrace.fromString(stackDescription); | 728 stackTrace = new StackTrace.fromString(stackDescription); |
729 String toString() => _description; | 729 String toString() => _description; |
730 } | 730 } |
OLD | NEW |