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

Side by Side Diff: pkg/scheduled_test/lib/scheduled_process.dart

Issue 203263003: Fix documentation in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fixes. Created 6 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 | « no previous file | sdk/lib/async/async.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library scheduled_test.scheduled_process; 5 library scheduled_test.scheduled_process;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // We purposefully avoid using wrapFuture here. If an error occurs while a 178 // We purposefully avoid using wrapFuture here. If an error occurs while a
179 // process is running, we want the schedule to move to the onException 179 // process is running, we want the schedule to move to the onException
180 // queue where the process will be killed, rather than blocking the tasks 180 // queue where the process will be killed, rather than blocking the tasks
181 // queue waiting for the process to exit. 181 // queue waiting for the process to exit.
182 _process.then((p) => Chain.track(p.exitCode)).then((exitCode) { 182 _process.then((p) => Chain.track(p.exitCode)).then((exitCode) {
183 _actualExitTask = currentSchedule.currentTask; 183 _actualExitTask = currentSchedule.currentTask;
184 exitCodeCompleter.complete(exitCode); 184 exitCodeCompleter.complete(exitCode);
185 }); 185 });
186 } 186 }
187 187
188 /// Converts a stream of bytes to a stream of lines and returns that along 188 /// Converts a stream of byte lists to a stream of lines and returns that
189 /// with a [StreamCanceller] controlling it. 189 /// along with a [StreamCanceller] controlling it.
190 Pair<Stream<String>, StreamCanceller> _lineStreamWithCanceller( 190 Pair<Stream<String>, StreamCanceller> _lineStreamWithCanceller(
191 Future<Stream<List<int>>> streamFuture) { 191 Future<Stream<List<int>>> streamFuture) {
192 return streamWithCanceller(futureStream(streamFuture) 192 return streamWithCanceller(futureStream(streamFuture)
193 .handleError(currentSchedule.signalError) 193 .handleError(currentSchedule.signalError)
194 .map((chunk) { 194 .map((chunk) {
195 // Whenever the process produces any sort of output, reset the schedule's 195 // Whenever the process produces any sort of output, reset the schedule's
196 // timer. 196 // timer.
197 currentSchedule.heartbeat(); 197 currentSchedule.heartbeat();
198 return chunk; 198 return chunk;
199 }) 199 })
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 schedule(() { 316 schedule(() {
317 return _exitCode.then((exitCode) { 317 return _exitCode.then((exitCode) {
318 if (expectedExitCode != null) { 318 if (expectedExitCode != null) {
319 expect(exitCode, equals(expectedExitCode)); 319 expect(exitCode, equals(expectedExitCode));
320 } 320 }
321 }); 321 });
322 }, "waiting for process '$description' to exit"); 322 }, "waiting for process '$description' to exit");
323 _scheduledExitTask = currentSchedule.tasks.contents.last; 323 _scheduledExitTask = currentSchedule.tasks.contents.last;
324 } 324 }
325 } 325 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/async/async.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698