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

Unified Diff: lib/isolate/isolate_api.dart

Issue 10837070: Remove old isolate API and update all code in the repository to use (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/isolate/dart2js/isolateimpl.dart ('k') | lib/isolate/isolate_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/isolate/isolate_api.dart
diff --git a/lib/isolate/isolate_api.dart b/lib/isolate/isolate_api.dart
index 3978b939d58145e61e2cc776a7ac32a1cb07777b..010007e2b5bd63f8ae59a3420ec226f2593fa35c 100644
--- a/lib/isolate/isolate_api.dart
+++ b/lib/isolate/isolate_api.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -146,98 +146,3 @@ interface SendPortSync {
callSync(var message);
}
-
-/**
- * NOTE: This API will be deprecated soon.
- *
- * The [Isolate] class serves two purposes: (1) as template for spawning a new
- * isolate, and (2) as entry-point for the newly spawned isolate.
- *
- * New isolates are spawned by sub-classing [Isolate] and then invoking
- * [:spawn:] on the instance. This will spawn a new isolate, which creates a
- * new instance of the class, initializes the instance's [port] field
- * and invokes the instance method [main].
- *
- * The new instance is created by invoking the default constructor of the
- * class that served as template for spawning the new isolate. This means, that
- * sub-classes must have a default constructor (i.e. no-argument constructor).
- *
- * Isolates may be "heavy" or "light". Heavy isolates live in their own thread,
- * whereas "light" isolates live in the same thread as the isolate which spawned
- * them.
- *
- * NOTE: once [spawnFunction] and [spawnUri] are supported in both frog and the
- * dartvm, this class will be removed. The distinction of heavy and light will
- * be removed too. Thus far the main use for 'light' isolates is for running
- * isolates that share access to the DOM. A special API will be added for this
- * purpose soon. See the library top-level comments for more details.
- */
-// TODO(sigmund): delete once we implement the new API in the vm
-class Isolate {
-
- /**
- * Redirects to [Isolate.light].
- */
- Isolate() : this.light();
-
- /**
- * Creates a new isolate-template for a light isolate.
- */
- Isolate.light() : _isLight = true;
-
- /**
- * Creates a new isolate-template for a heavy isolate.
- */
- Isolate.heavy() : _isLight = false;
-
- /**
- * Spawns a new isolate, using this instance as template.
- *
- * The new isolate lives in a new thread (for heavy templates)
- * or in the same thread as the current isolate (for light templates), if
- * possible.
- *
- * During the initialization of the new isolate a [ReceivePort] is created
- * inside the new isolate and stored in the read-only field [port].
- * A corresponding [SendPort] is sent to the isolate that invoked [spawn].
- * Since spawning an isolate is an asynchronous operation this method returns
- * a [Future] of this [SendPort].
- *
- * A common pattern to instantiate new isolates is to enqueue the instructions
- * using [Future.then].
- * [:myIsolate.spawn().then((SendPort port) { port.send('hi there'); });:]
- */
- Future<SendPort> spawn() {
- return _IsolateNatives.spawn(this, _isLight);
- }
-
- // The private run method is invoked with the receive port. Before
- // main is invoked we store the port in a field so it can be
- // accessed from subclasses of Isolate.
- void _run(ReceivePort port) {
- _port = port;
- main();
- }
-
- /**
- * When [Isolate]s are used as entry-points, the [port] field contains a
- * [ReceivePort]. The isolate that initiated the spawn holds a corresponding
- * [SendPort].
- *
- * Note that isolates should generally close their [ReceivePort]s when they
- * are done, including this port.
- */
- ReceivePort get port() {
- return _port;
- }
-
- /**
- * When isolates are created, an instance of the template's class is
- * instantiated in the new isolate. After the [port] has been set up, this
- * [main] method is invoked on the instance.
- */
- abstract void main();
-
- final bool _isLight;
- ReceivePort _port;
-}
« no previous file with comments | « lib/isolate/dart2js/isolateimpl.dart ('k') | lib/isolate/isolate_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698