| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * [IsolateSink]s represent the feed for [IsolateStream]s. Any message written | 91 * [IsolateSink]s represent the feed for [IsolateStream]s. Any message written |
| 92 * to [this] is delivered to its respective [IsolateStream]. [IsolateSink]s are | 92 * to [this] is delivered to its respective [IsolateStream]. [IsolateSink]s are |
| 93 * created by [MessageBox]es. | 93 * created by [MessageBox]es. |
| 94 * | 94 * |
| 95 * [IsolateSink]s can be transmitted to other isolates. | 95 * [IsolateSink]s can be transmitted to other isolates. |
| 96 */ | 96 */ |
| 97 abstract class IsolateSink extends StreamSink<dynamic> { | 97 abstract class IsolateSink extends EventSink<dynamic> { |
| 98 // TODO(8997): Implement EventSink instead. | |
| 99 // TODO(floitsch): Actually it should be a StreamSink (being able to flow- | 98 // TODO(floitsch): Actually it should be a StreamSink (being able to flow- |
| 100 // control). | 99 // control). |
| 101 | 100 |
| 102 /** | 101 /** |
| 103 * Sends an asynchronous [message] to the linked [IsolateStream]. The message | 102 * Sends an asynchronous [message] to the linked [IsolateStream]. The message |
| 104 * is copied to the receiving isolate. | 103 * is copied to the receiving isolate. |
| 105 * | 104 * |
| 106 * The content of [message] can be: primitive values (null, num, bool, double, | 105 * The content of [message] can be: primitive values (null, num, bool, double, |
| 107 * String), instances of [IsolateSink]s, and lists and maps whose elements are | 106 * String), instances of [IsolateSink]s, and lists and maps whose elements are |
| 108 * any of these. List and maps are also allowed to be cyclic. | 107 * any of these. List and maps are also allowed to be cyclic. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 * default stream. | 141 * default stream. |
| 143 * | 142 * |
| 144 * The optional [unhandledExceptionCallback] argument is invoked whenever an | 143 * The optional [unhandledExceptionCallback] argument is invoked whenever an |
| 145 * exception inside the isolate is unhandled. It can be seen as a big | 144 * exception inside the isolate is unhandled. It can be seen as a big |
| 146 * `try/catch` around everything that is executed inside the isolate. The | 145 * `try/catch` around everything that is executed inside the isolate. The |
| 147 * callback should return `true` when it was able to handled the exception. | 146 * callback should return `true` when it was able to handled the exception. |
| 148 */ | 147 */ |
| 149 external IsolateSink streamSpawnFunction( | 148 external IsolateSink streamSpawnFunction( |
| 150 void topLevelFunction(), | 149 void topLevelFunction(), |
| 151 [bool unhandledExceptionCallback(IsolateUnhandledException e)]); | 150 [bool unhandledExceptionCallback(IsolateUnhandledException e)]); |
| OLD | NEW |