| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 barback.node_streams; | 5 library barback.graph.node_streams; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'asset_node.dart'; | 9 import '../asset/asset_node.dart'; |
| 10 import 'log.dart'; | 10 import '../log.dart'; |
| 11 import '../utils/stream_pool.dart'; |
| 11 import 'node_status.dart'; | 12 import 'node_status.dart'; |
| 12 import 'stream_pool.dart'; | |
| 13 | 13 |
| 14 /// A collection of streams that are common to nodes in barback's package graph. | 14 /// A collection of streams that are common to nodes in barback's package graph. |
| 15 class NodeStreams { | 15 class NodeStreams { |
| 16 /// A stream that emits an event every time the node's status changes. | 16 /// A stream that emits an event every time the node's status changes. |
| 17 /// | 17 /// |
| 18 /// This will emit the new status. It's guaranteed to emit an event only when | 18 /// This will emit the new status. It's guaranteed to emit an event only when |
| 19 /// the status changes from the previous value. To ensure this, callers should | 19 /// the status changes from the previous value. To ensure this, callers should |
| 20 /// emit status changes using [changeStatus]. The initial status is assumed to | 20 /// emit status changes using [changeStatus]. The initial status is assumed to |
| 21 /// be [NodeStatus.RUNNING]. | 21 /// be [NodeStatus.RUNNING]. |
| 22 Stream<NodeStatus> get onStatusChange => _onStatusChangeController.stream; | 22 Stream<NodeStatus> get onStatusChange => _onStatusChangeController.stream; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 /// Closes all the streams. | 58 /// Closes all the streams. |
| 59 void close() { | 59 void close() { |
| 60 _onStatusChangeController.close(); | 60 _onStatusChangeController.close(); |
| 61 onAssetController.close(); | 61 onAssetController.close(); |
| 62 onAssetPool.close(); | 62 onAssetPool.close(); |
| 63 onLogController.close(); | 63 onLogController.close(); |
| 64 onLogPool.close(); | 64 onLogPool.close(); |
| 65 } | 65 } |
| 66 } | 66 } |
| OLD | NEW |