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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 /** | 120 /** |
121 * Return the current [Isolate]. | 121 * Return the current [Isolate]. |
122 * | 122 * |
123 * The isolate gives access to the capabilities needed to inspect, | 123 * The isolate gives access to the capabilities needed to inspect, |
124 * pause or kill the isolate, and allows granting these capabilities | 124 * pause or kill the isolate, and allows granting these capabilities |
125 * to others. | 125 * to others. |
126 */ | 126 */ |
127 external static Isolate get current; | 127 external static Isolate get current; |
128 | 128 |
129 /** | 129 /** |
130 * Returns the package root of the current isolate, if any. | |
131 * | |
132 * If the isolate is using a [packageMap], this getter returns `null`, | |
133 * otherwise it returns the package root - a directory that package | |
134 * URIs are resolved against. | |
135 */ | |
136 external static Future<Uri> get packageRoot; | |
nweiz
2015/10/06 23:33:21
Are there any guarantees about whether this is abs
Lasse Reichstein Nielsen
2015/10/07 07:48:28
It should be absolute. We should add this to the d
| |
137 | |
138 /** | |
139 * Returns the package mapping of the current isolate, if any. | |
140 * | |
141 * If the current isolate is using a [packageRoot], this getter | |
142 * returns `null`. | |
143 * | |
144 * The package map maps the name of a package that is available to the | |
145 * program, to a URI that package URIs for that package are resolved against. | |
146 * | |
147 * Returns an empty map if the isolate does not have a way to resolve package | |
148 * URIs. | |
149 */ | |
150 external static Future<Map<String, Uri>> get packageMap; | |
151 | |
152 /** | |
130 * Creates and spawns an isolate that shares the same code as the current | 153 * Creates and spawns an isolate that shares the same code as the current |
131 * isolate. | 154 * isolate. |
132 * | 155 * |
133 * The argument [entryPoint] specifies the entry point of the spawned | 156 * The argument [entryPoint] specifies the entry point of the spawned |
134 * isolate. It must be a top-level function or a static method that | 157 * isolate. It must be a top-level function or a static method that |
135 * takes one argument - that is, one-parameter functions that can be | 158 * takes one argument - that is, one-parameter functions that can be |
136 * compile-time constant function values. | 159 * compile-time constant function values. |
137 * It is not allowed to pass the value of function expressions or an instance | 160 * It is not allowed to pass the value of function expressions or an instance |
138 * method extracted from an object. | 161 * method extracted from an object. |
139 * | 162 * |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
657 * as the original error, but has no other features of the original error. | 680 * as the original error, but has no other features of the original error. |
658 */ | 681 */ |
659 class RemoteError implements Error { | 682 class RemoteError implements Error { |
660 final String _description; | 683 final String _description; |
661 final StackTrace stackTrace; | 684 final StackTrace stackTrace; |
662 RemoteError(String description, String stackDescription) | 685 RemoteError(String description, String stackDescription) |
663 : _description = description, | 686 : _description = description, |
664 stackTrace = new StackTrace.fromString(stackDescription); | 687 stackTrace = new StackTrace.fromString(stackDescription); |
665 String toString() => _description; | 688 String toString() => _description; |
666 } | 689 } |
OLD | NEW |