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

Unified Diff: runtime/bin/process.dart

Issue 11091070: Change Process.start to return a future that completes with a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restructure to get rid of _onStart and _onError Created 8 years, 2 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/compiler/implementation/lib/io.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process.dart
diff --git a/runtime/bin/process.dart b/runtime/bin/process.dart
index ca6c097e9438b5ffa8b62094e8b6076e61f5f205..e5a56184b32ddbee02ee13773aa5d8171ef21056 100644
--- a/runtime/bin/process.dart
+++ b/runtime/bin/process.dart
@@ -17,23 +17,19 @@ void exit(int status) {
class Process {
/**
* Starts a process running the [executable] with the specified
- * [arguments]. Returns a [Process] instance that can be used to
- * interact with the process.
+ * [arguments]. Returns a [:Future<Process>:] that completes with a
+ * Process instance when the process has been successfully
+ * started. That [Process] object can be used to interact with the
+ * process. If the process cannot be started the returned [Future]
+ * completes with an exception.
*
* An optional [ProcessOptions] object can be passed to specify
* options other than the executable and the arguments.
- *
- * When the process has been successfully started [onStart] is
- * called on the returned Process object. If the process fails to
- * start [onError] is called on the returned Process object.
- *
- * No data can be written to the process stdin and the process
- * cannot be closed nor killed before [onStart] has been invoked.
*/
- static Process start(String executable,
- List<String> arguments,
- [ProcessOptions options]) {
- return new _Process.start(executable, arguments, options);
+ static Future<Process> start(String executable,
+ List<String> arguments,
+ [ProcessOptions options]) {
+ return _Process.start(executable, arguments, options);
}
/**
@@ -78,12 +74,6 @@ class Process {
abstract OutputStream get stdin;
/**
- * Set the start handler which gets invoked when the process is
- * successfully started.
- */
- abstract void set onStart(void callback());
-
- /**
* Sets an exit handler which gets invoked when the process
* terminates.
*
@@ -93,18 +83,12 @@ class Process {
abstract void set onExit(void callback(int exitCode));
/**
- * Set an error handler which gets invoked if an operation on the process
- * fails.
- */
- abstract void set onError(void callback(e));
-
- /**
* On Windows, [kill] kills the process, ignoring the [signal]
* flag. On Posix systems, [kill] sends [signal] to the
* process. Depending on the signal giving, it'll have different
* meanings. When the process terminates as a result of calling
- * [kill] [onExit] is called. If the kill operation fails, [onError]
- * is called.
+ * [kill] [onExit] is called. If the kill operation fails an
+ * exception is thrown.
*/
abstract void kill([ProcessSignal signal = ProcessSignal.SIGTERM]);
« no previous file with comments | « lib/compiler/implementation/lib/io.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698