| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 async.stream_sink_transformer.handler_transformer; | |
| 6 | |
| 7 import 'dart:async'; | 5 import 'dart:async'; |
| 8 | 6 |
| 9 import '../stream_sink_transformer.dart'; | 7 import '../stream_sink_transformer.dart'; |
| 10 import '../delegate/stream_sink.dart'; | 8 import '../delegate/stream_sink.dart'; |
| 11 | 9 |
| 12 /// The type of the callback for handling data events. | 10 /// The type of the callback for handling data events. |
| 13 typedef void HandleData<S, T>(S data, EventSink<T> sink); | 11 typedef void HandleData<S, T>(S data, EventSink<T> sink); |
| 14 | 12 |
| 15 /// The type of the callback for handling error events. | 13 /// The type of the callback for handling error events. |
| 16 typedef void HandleError<T>( | 14 typedef void HandleError<T>( |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 class _SafeCloseSink<T> extends DelegatingStreamSink<T> { | 96 class _SafeCloseSink<T> extends DelegatingStreamSink<T> { |
| 99 _SafeCloseSink(StreamSink<T> inner) : super(inner); | 97 _SafeCloseSink(StreamSink<T> inner) : super(inner); |
| 100 | 98 |
| 101 Future close() => super.close().catchError((_) {}); | 99 Future close() => super.close().catchError((_) {}); |
| 102 } | 100 } |
| 103 | 101 |
| 104 /// A function to pass as a [StreamTransformer]'s `handleDone` callback. | 102 /// A function to pass as a [StreamTransformer]'s `handleDone` callback. |
| 105 void _closeSink(EventSink sink) { | 103 void _closeSink(EventSink sink) { |
| 106 sink.close(); | 104 sink.close(); |
| 107 } | 105 } |
| OLD | NEW |