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

Side by Side Diff: dart/sdk/lib/async/stream.dart

Issue 11783011: Don't use redirecting factories with type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | dart/tests/lib/lib.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 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 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 // part of dart.async; 5 // part of dart.async;
6 6
7 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Core Stream types 8 // Core Stream types
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 12 matching lines...) Expand all
23 }); 23 });
24 return controller.stream; 24 return controller.stream;
25 } 25 }
26 26
27 /** 27 /**
28 * Stream that outputs events from the [sources] in cyclic order. 28 * Stream that outputs events from the [sources] in cyclic order.
29 * 29 *
30 * The merged streams are paused and resumed in order to ensure the proper 30 * The merged streams are paused and resumed in order to ensure the proper
31 * order of output events. 31 * order of output events.
32 */ 32 */
33 factory Stream.cyclic(Iterable<Stream> sources) = CyclicScheduleStream<T>; 33 factory Stream.cyclic(Iterable<Stream> sources) {
34 return new CyclicScheduleStream<T>(sources);
35 }
34 36
35 /** 37 /**
36 * Create a stream that forwards data from the highest priority active source. 38 * Create a stream that forwards data from the highest priority active source.
37 * 39 *
38 * Sources are provided in order of increasing priority, and only data from 40 * Sources are provided in order of increasing priority, and only data from
39 * the highest priority source stream that has provided data are output 41 * the highest priority source stream that has provided data are output
40 * on the created stream. 42 * on the created stream.
41 * 43 *
42 * Errors from the most recent active stream, and any higher priority stream, 44 * Errors from the most recent active stream, and any higher priority stream,
43 * are forwarded to the created stream. 45 * are forwarded to the created stream.
44 * 46 *
45 * If a higher priority source stream completes without providing data, 47 * If a higher priority source stream completes without providing data,
46 * it will have no effect on lower priority streams. 48 * it will have no effect on lower priority streams.
47 */ 49 */
48 factory Stream.superceding(Iterable<Stream<T>> sources) = SupercedeStream<T>; 50 factory Stream.superceding(Iterable<Stream<T>> sources) {
51 return new SupercedeStream<T>(sources);
52 }
49 53
50 /** 54 /**
51 * Add a subscription to this stream. 55 * Add a subscription to this stream.
52 * 56 *
53 * On each data event from this stream, the subscribers [onData] handler 57 * On each data event from this stream, the subscribers [onData] handler
54 * is called. If [onData] is null, nothing happens. 58 * is called. If [onData] is null, nothing happens.
55 * 59 *
56 * On errors from this stream, the [onError] handler is given a 60 * On errors from this stream, the [onError] handler is given a
57 * [AsyncError] object describing the error. 61 * [AsyncError] object describing the error.
58 * 62 *
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 sink.signalError(error); 833 sink.signalError(error);
830 } 834 }
831 835
832 /** 836 /**
833 * Handle an incoming done event. 837 * Handle an incoming done event.
834 */ 838 */
835 void handleDone(StreamSink<T> sink) { 839 void handleDone(StreamSink<T> sink) {
836 sink.close(); 840 sink.close();
837 } 841 }
838 } 842 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698