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

Side by Side Diff: pkg/barback/lib/src/transform_node.dart

Issue 200473006: Make barback's onAsset streams broadcast rather than single-subscriber. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/barback/lib/src/phase_output.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.transform_node; 5 library barback.transform_node;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset.dart'; 9 import 'asset.dart';
10 import 'asset_id.dart'; 10 import 'asset_id.dart';
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 /// This is synchronous in order to guarantee that it will emit an event as 66 /// This is synchronous in order to guarantee that it will emit an event as
67 /// soon as [isDirty] flips from `true` to `false`. 67 /// soon as [isDirty] flips from `true` to `false`.
68 Stream get onDone => _onDoneController.stream; 68 Stream get onDone => _onDoneController.stream;
69 final _onDoneController = new StreamController.broadcast(sync: true); 69 final _onDoneController = new StreamController.broadcast(sync: true);
70 70
71 /// A stream that emits any new assets emitted by [this]. 71 /// A stream that emits any new assets emitted by [this].
72 /// 72 ///
73 /// Assets are emitted synchronously to ensure that any changes are thoroughly 73 /// Assets are emitted synchronously to ensure that any changes are thoroughly
74 /// propagated as soon as they occur. 74 /// propagated as soon as they occur.
75 Stream<AssetNode> get onAsset => _onAssetController.stream; 75 Stream<AssetNode> get onAsset => _onAssetController.stream;
76 final _onAssetController = new StreamController<AssetNode>(sync: true); 76 final _onAssetController =
77 new StreamController<AssetNode>.broadcast(sync: true);
77 78
78 /// A stream that emits an event whenever this transform logs an entry. 79 /// A stream that emits an event whenever this transform logs an entry.
79 /// 80 ///
80 /// This is synchronous because error logs can cause the transform to fail, so 81 /// This is synchronous because error logs can cause the transform to fail, so
81 /// we need to ensure that their processing isn't delayed until after the 82 /// we need to ensure that their processing isn't delayed until after the
82 /// transform or build has finished. 83 /// transform or build has finished.
83 Stream<LogEntry> get onLog => _onLogPool.stream; 84 Stream<LogEntry> get onLog => _onLogPool.stream;
84 final _onLogPool = new StreamPool<LogEntry>.broadcast(); 85 final _onLogPool = new StreamPool<LogEntry>.broadcast();
85 86
86 /// The current state of [this]. 87 /// The current state of [this].
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 /// 492 ///
492 /// Specifically, whether [this] is [APPLIED] or [NOT_PRIMARY]. 493 /// Specifically, whether [this] is [APPLIED] or [NOT_PRIMARY].
493 bool get isDone => isApplied || isNotPrimary; 494 bool get isDone => isApplied || isNotPrimary;
494 495
495 final String name; 496 final String name;
496 497
497 const _TransformNodeState._(this.name); 498 const _TransformNodeState._(this.name);
498 499
499 String toString() => name; 500 String toString() => name;
500 } 501 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/phase_output.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698