| 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 part of dart.isolate; | 5 part of dart.isolate; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The initial [IsolateStream] available by default for this isolate. This | 8 * The initial [IsolateStream] available by default for this isolate. This |
| 9 * [IsolateStream] is created automatically and it is commonly used to establish | 9 * [IsolateStream] is created automatically and it is commonly used to establish |
| 10 * the first communication between isolates (see [streamSpawnFunction] and | 10 * the first communication between isolates (see [streamSpawnFunction] and |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 * | 191 * |
| 192 * When any isolate starts (even the main script of the application), a default | 192 * When any isolate starts (even the main script of the application), a default |
| 193 * [IsolateStream] is created for it. This sink is available from the top-level | 193 * [IsolateStream] is created for it. This sink is available from the top-level |
| 194 * getter [stream] defined in this library. | 194 * getter [stream] defined in this library. |
| 195 * | 195 * |
| 196 * [spawnFunction] returns an [IsolateSink] feeding into the child isolate's | 196 * [spawnFunction] returns an [IsolateSink] feeding into the child isolate's |
| 197 * default stream. | 197 * default stream. |
| 198 * | 198 * |
| 199 * See comments at the top of this library for more details. | 199 * See comments at the top of this library for more details. |
| 200 */ | 200 */ |
| 201 IsolateSink streamSpawnFunction(void topLevelFunction()) { | 201 IsolateSink streamSpawnFunction( |
| 202 SendPort sendPort = spawnFunction(topLevelFunction); | 202 void topLevelFunction(), |
| 203 [bool unhandledExceptionCallback(IsolateUnhandledException e)]) { |
| 204 SendPort sendPort = spawnFunction(topLevelFunction, |
| 205 unhandledExceptionCallback); |
| 203 return new IsolateSink._fromPort(sendPort); | 206 return new IsolateSink._fromPort(sendPort); |
| 204 } | 207 } |
| 205 | 208 |
| 206 /** | 209 /** |
| 207 * Creates and spawns an isolate whose code is available at [uri]. Like with | 210 * Creates and spawns an isolate whose code is available at [uri]. Like with |
| 208 * [streamSpawnFunction], the child isolate will have a default [IsolateStream], | 211 * [streamSpawnFunction], the child isolate will have a default [IsolateStream], |
| 209 * and a this function returns an [IsolateSink] feeding into it. | 212 * and a this function returns an [IsolateSink] feeding into it. |
| 210 * | 213 * |
| 211 * See comments at the top of this library for more details. | 214 * See comments at the top of this library for more details. |
| 212 */ | 215 */ |
| 213 IsolateSink streamSpawnUri(String uri) { | 216 IsolateSink streamSpawnUri(String uri) { |
| 214 SendPort sendPort = spawnUri(uri); | 217 SendPort sendPort = spawnUri(uri); |
| 215 return new IsolateSink._fromPort(sendPort); | 218 return new IsolateSink._fromPort(sendPort); |
| 216 } | 219 } |
| OLD | NEW |