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

Unified Diff: pkg/barback/lib/src/group_runner.dart

Issue 261823008: Reorganize barback's source files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: re-add barback/lib/src/internal_asset.dart Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/barback/lib/src/graph/transformer_classifier.dart ('k') | pkg/barback/lib/src/internal_asset.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/group_runner.dart
diff --git a/pkg/barback/lib/src/group_runner.dart b/pkg/barback/lib/src/group_runner.dart
deleted file mode 100644
index e17f7fe871595326c3ef11172c751dad7f604dc8..0000000000000000000000000000000000000000
--- a/pkg/barback/lib/src/group_runner.dart
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library barback.group_runner;
-
-import 'dart:async';
-
-import 'asset_cascade.dart';
-import 'asset_node.dart';
-import 'log.dart';
-import 'node_status.dart';
-import 'phase.dart';
-import 'stream_pool.dart';
-import 'transformer_group.dart';
-
-/// A class that processes all of the phases in a single transformer group.
-///
-/// A group takes many inputs, processes them, and emits many outputs.
-class GroupRunner {
- /// The group this runner runs.
- final TransformerGroup _group;
-
- /// A string describing the location of [this] in the transformer graph.
- final String _location;
-
- /// The phases defined by this group.
- final _phases = new List<Phase>();
-
- /// How far along [this] is in processing its assets.
- NodeStatus get status {
- // Just check the last phase, since it will check all the previous phases
- // itself.
- return _phases.last.status;
- }
-
- /// A stream that emits an event every time the group's status changes.
- Stream<NodeStatus> get onStatusChange => _onStatusChange;
- Stream _onStatusChange;
-
- /// A stream that emits any new assets emitted by [this].
- ///
- /// Assets are emitted synchronously to ensure that any changes are thoroughly
- /// propagated as soon as they occur.
- Stream<AssetNode> get onAsset => _onAsset;
- Stream<AssetNode> _onAsset;
-
- /// A stream that emits an event whenever any transforms in this group logs
- /// an entry.
- Stream<LogEntry> get onLog => _onLogPool.stream;
- final _onLogPool = new StreamPool<LogEntry>.broadcast();
-
- GroupRunner(AssetCascade cascade, this._group, this._location) {
- _addPhase(new Phase(cascade, _location), []);
- for (var phase in _group.phases) {
- _addPhase(_phases.last.addPhase(), phase);
- }
-
- _onAsset = _phases.last.onAsset;
- _onStatusChange = _phases.last.onStatusChange;
- }
-
- /// Add a phase with [contents] to [this]'s list of phases.
- ///
- /// [contents] should be an inner [Iterable] from a [TransformGroup.phases]
- /// value.
- void _addPhase(Phase phase, Iterable contents) {
- _phases.add(phase);
- _onLogPool.add(phase.onLog);
- phase.updateTransformers(contents);
- }
-
- /// Force all [LazyTransformer]s' transforms in this group to begin producing
- /// concrete assets.
- void forceAllTransforms() {
- for (var phase in _phases) {
- phase.forceAllTransforms();
- }
- }
-
- /// Adds a new asset as an input for this group.
- void addInput(AssetNode node) {
- _phases.first.addInput(node);
- }
-
- /// Removes this group and all sub-phases within it.
- void remove() {
- _onLogPool.close();
- for (var phase in _phases) {
- phase.remove();
- }
- }
-
- String toString() => "group in phase $_location for $_group";
-}
« no previous file with comments | « pkg/barback/lib/src/graph/transformer_classifier.dart ('k') | pkg/barback/lib/src/internal_asset.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698