| OLD | NEW |
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Deprecated method, previously called 'pipe', retained for compatibility. | 174 // Deprecated method, previously called 'pipe', retained for compatibility. |
| 175 Future pipeInto(Sink<T> sink, | 175 Future pipeInto(Sink<T> sink, |
| 176 {void onError(AsyncError error), | 176 {void onError(AsyncError error), |
| 177 bool unsubscribeOnError}) { | 177 bool unsubscribeOnError}) { |
| 178 _FutureImpl<T> result = new _FutureImpl<T>(); | 178 _FutureImpl<T> result = new _FutureImpl<T>(); |
| 179 this.listen( | 179 this.listen( |
| 180 sink.add, | 180 sink.add, |
| 181 onError: onError, | 181 onError: onError, |
| 182 onDone: () { | 182 onDone: () { |
| 183 sink.close(); | 183 sink.close(); |
| 184 result.setValue(null); | 184 result._setValue(null); |
| 185 }, | 185 }, |
| 186 unsubscribeOnError: unsubscribeOnError); | 186 unsubscribeOnError: unsubscribeOnError); |
| 187 return result; | 187 return result; |
| 188 } | 188 } |
| 189 | 189 |
| 190 | 190 |
| 191 /** | 191 /** |
| 192 * Check whether [match] occurs in the elements provided by this stream. | 192 * Check whether [match] occurs in the elements provided by this stream. |
| 193 * | 193 * |
| 194 * Completes the [Future] when the answer is known. | 194 * Completes the [Future] when the answer is known. |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 sink.signalError(error); | 852 sink.signalError(error); |
| 853 } | 853 } |
| 854 | 854 |
| 855 /** | 855 /** |
| 856 * Handle an incoming done event. | 856 * Handle an incoming done event. |
| 857 */ | 857 */ |
| 858 void handleDone(StreamSink<T> sink) { | 858 void handleDone(StreamSink<T> sink) { |
| 859 sink.close(); | 859 sink.close(); |
| 860 } | 860 } |
| 861 } | 861 } |
| OLD | NEW |