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

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

Issue 295913003: Make Stream.where, etc., be documented as inheriting broadcast state. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add issue number for co19 status changes. Created 6 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 | « sdk/lib/async/stream.dart ('k') | tests/co19/co19-co19.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) 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 part of dart.async; 5 part of dart.async;
6 6
7 /** 7 /**
8 * Wraps an [_EventSink] so it exposes only the [EventSink] interface. 8 * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
9 */ 9 */
10 class _EventSinkWrapper<T> implements EventSink<T> { 10 class _EventSinkWrapper<T> implements EventSink<T> {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 * The result of binding a StreamTransformer for Sink-mappers. 164 * The result of binding a StreamTransformer for Sink-mappers.
165 * 165 *
166 * It contains the bound Stream and the sink-mapper. Only when the user starts 166 * It contains the bound Stream and the sink-mapper. Only when the user starts
167 * listening to this stream is the sink-mapper invoked. The result is used 167 * listening to this stream is the sink-mapper invoked. The result is used
168 * to create a StreamSubscription that transforms events. 168 * to create a StreamSubscription that transforms events.
169 */ 169 */
170 class _BoundSinkStream<S, T> extends Stream<T> { 170 class _BoundSinkStream<S, T> extends Stream<T> {
171 final _SinkMapper<S, T> _sinkMapper; 171 final _SinkMapper<S, T> _sinkMapper;
172 final Stream<S> _stream; 172 final Stream<S> _stream;
173 173
174 bool get isBroadcast => _stream.isBroadcast;
175
174 _BoundSinkStream(this._stream, this._sinkMapper); 176 _BoundSinkStream(this._stream, this._sinkMapper);
175 177
176 StreamSubscription<T> listen(void onData(T event), 178 StreamSubscription<T> listen(void onData(T event),
177 { Function onError, 179 { Function onError,
178 void onDone(), 180 void onDone(),
179 bool cancelOnError }) { 181 bool cancelOnError }) {
180 cancelOnError = identical(true, cancelOnError); 182 cancelOnError = identical(true, cancelOnError);
181 StreamSubscription<T> subscription = new _SinkTransformerStreamSubscription( 183 StreamSubscription<T> subscription = new _SinkTransformerStreamSubscription(
182 _stream, _sinkMapper, cancelOnError); 184 _stream, _sinkMapper, cancelOnError);
183 subscription.onData(onData); 185 subscription.onData(onData);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 void onDone(), 302 void onDone(),
301 bool cancelOnError }) { 303 bool cancelOnError }) {
302 cancelOnError = identical(true, cancelOnError); 304 cancelOnError = identical(true, cancelOnError);
303 StreamSubscription<T> result = _transformer(_stream, cancelOnError); 305 StreamSubscription<T> result = _transformer(_stream, cancelOnError);
304 result.onData(onData); 306 result.onData(onData);
305 result.onError(onError); 307 result.onError(onError);
306 result.onDone(onDone); 308 result.onDone(onDone);
307 return result; 309 return result;
308 } 310 }
309 } 311 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698