Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: frog/lib/newisolate.dart

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/lib/isolate_serialization.dart ('k') | frog/minfrog » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // TODO(sigmund): separate isolates from dart:core
6 // #library('dart:isolate');
7
8 /**
9 * [Isolate2] provides APIs to spawn, communicate, and stop an isolate. An
10 * isolate can be spawned by simply creating a new instance of [Isolate2]. The
11 * [Isolate2] instance exposes a port to communicate with the isolate and
12 * methods to control its behavior remotely.
13 */
14 // TODO(sigmund): rename to Isolate once we delete the old implementation
15 interface Isolate2 default IsolateFactory {
16
17 /**
18 * Create and spawn an isolate that shares the same code as the current
19 * isolate, but that starts from [topLevelFunction]. The [topLevelFunction]
20 * argument must be a static method closure that takes exactly one
21 * argument of type [ReceivePort]. It is illegal to pass a function closure
22 * that captures values in scope.
23 *
24 * When an child isolate is spawned, a new [ReceivePort] is created for it.
25 * This port is passed to [topLevelFunction]. A [SendPort] derived from
26 * such port is sent to the spawner isolate, which is accessible in
27 * [Isolate2.sendPort] field of this instance.
28 */
29 Isolate2.fromCode(Function topLevelFunction);
30
31 /**
32 * Create and spawn an isolate whose code is available at [uri].
33 * The code in [uri] must have an method called [: isolateMain :], which takes
34 * exactly one argument of type [ReceivePort].
35 * Like with [Isolate2.fromCode], a [ReceivePort] is created in the child
36 * isolate, and a [SendPort] to it is stored in [Isolate2.sendPort].
37 */
38 Isolate2.fromUri(String uri);
39
40 /** Port used to communicate with this isolate. */
41 SendPort sendPort;
42
43 /** Stop this isolate. */
44 void stop();
45 }
46
OLDNEW
« no previous file with comments | « frog/lib/isolate_serialization.dart ('k') | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698