| OLD | NEW |
| 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 library barback.phase_output; | 5 library barback.phase_output; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'asset_cascade.dart'; | 10 import 'asset_cascade.dart'; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 /// A string describing the location of [this] in the transformer graph. | 31 /// A string describing the location of [this] in the transformer graph. |
| 32 final String _location; | 32 final String _location; |
| 33 | 33 |
| 34 /// The asset node for this output. | 34 /// The asset node for this output. |
| 35 AssetNode get output => _outputForwarder.node; | 35 AssetNode get output => _outputForwarder.node; |
| 36 AssetForwarder _outputForwarder; | 36 AssetForwarder _outputForwarder; |
| 37 | 37 |
| 38 /// A stream that emits an [AssetNode] each time this output starts forwarding | 38 /// A stream that emits an [AssetNode] each time this output starts forwarding |
| 39 /// a new asset. | 39 /// a new asset. |
| 40 Stream<AssetNode> get onAsset => _onAssetController.stream; | 40 Stream<AssetNode> get onAsset => _onAssetController.stream; |
| 41 final _onAssetController = new StreamController<AssetNode>(sync: true); | 41 final _onAssetController = new StreamController<AssetNode>(); |
| 42 | 42 |
| 43 /// The assets for this output. | 43 /// The assets for this output. |
| 44 /// | 44 /// |
| 45 /// If there's no collision, this will only have one element. Otherwise, it | 45 /// If there's no collision, this will only have one element. Otherwise, it |
| 46 /// will be ordered by which asset was added first. | 46 /// will be ordered by which asset was added first. |
| 47 final _assets = new Queue<AssetNode>(); | 47 final _assets = new Queue<AssetNode>(); |
| 48 | 48 |
| 49 /// The [AssetCollisionException] for this output, or null if there is no | 49 /// The [AssetCollisionException] for this output, or null if there is no |
| 50 /// collision currently. | 50 /// collision currently. |
| 51 AssetCollisionException get collisionException { | 51 AssetCollisionException get collisionException { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // Pump the event queue to ensure that the removal of the input triggers | 108 // Pump the event queue to ensure that the removal of the input triggers |
| 109 // a new build to which we can attach the error. | 109 // a new build to which we can attach the error. |
| 110 // TODO(nweiz): report this through the output asset. | 110 // TODO(nweiz): report this through the output asset. |
| 111 newFuture(() => _phase.cascade.reportError(collisionException)); | 111 newFuture(() => _phase.cascade.reportError(collisionException)); |
| 112 } | 112 } |
| 113 }); | 113 }); |
| 114 } | 114 } |
| 115 | 115 |
| 116 String toString() => "phase output in $_location for $output"; | 116 String toString() => "phase output in $_location for $output"; |
| 117 } | 117 } |
| OLD | NEW |