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

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

Issue 15184003: Add additional Schedule heartbeat calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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/_internal/pub/lib/src/hosted_source.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:io'; 8 import 'dart:io';
9 9
10 import 'scheduled_test.dart'; 10 import 'scheduled_test.dart';
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 "'$description'"); 181 "'$description'");
182 }); 182 });
183 } 183 }
184 184
185 /// Converts a stream of bytes to a stream of lines and returns that along 185 /// Converts a stream of bytes to a stream of lines and returns that along
186 /// with a [StreamCanceller] controlling it. 186 /// with a [StreamCanceller] controlling it.
187 Pair<Stream<String>, StreamCanceller> _lineStreamWithCanceller( 187 Pair<Stream<String>, StreamCanceller> _lineStreamWithCanceller(
188 Future<Stream<List<int>>> streamFuture) { 188 Future<Stream<List<int>>> streamFuture) {
189 return streamWithCanceller(futureStream(streamFuture) 189 return streamWithCanceller(futureStream(streamFuture)
190 .handleError((e) => currentSchedule.signalError(e)) 190 .handleError((e) => currentSchedule.signalError(e))
191 .map((chunk) {
192 // Whenever the process produces any sort of output, reset the schedule's
193 // timer.
194 currentSchedule.heartbeat();
195 return chunk;
196 })
191 .transform(new StringDecoder(_encoding)) 197 .transform(new StringDecoder(_encoding))
192 .transform(new LineTransformer())); 198 .transform(new LineTransformer()));
193 } 199 }
194 200
195 /// Schedule an exception handler that will clean up the process and provide 201 /// Schedule an exception handler that will clean up the process and provide
196 /// debug information if an error occurs. 202 /// debug information if an error occurs.
197 void _scheduleExceptionCleanup() { 203 void _scheduleExceptionCleanup() {
198 currentSchedule.onException.schedule(() { 204 currentSchedule.onException.schedule(() {
199 _stdoutCanceller(); 205 _stdoutCanceller();
200 _stderrCanceller(); 206 _stderrCanceller();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 schedule(() { 336 schedule(() {
331 _endExpected = true; 337 _endExpected = true;
332 return _exitCode.then((exitCode) { 338 return _exitCode.then((exitCode) {
333 if (expectedExitCode != null) { 339 if (expectedExitCode != null) {
334 expect(exitCode, equals(expectedExitCode)); 340 expect(exitCode, equals(expectedExitCode));
335 } 341 }
336 }); 342 });
337 }, "waiting for process '$description' to exit"); 343 }, "waiting for process '$description' to exit");
338 } 344 }
339 } 345 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/hosted_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698