Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deprecate Supply.for in favour of .from-list
  • Loading branch information
lizmat committed Dec 22, 2014
1 parent f57427b commit 828d0df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/core/Supply.pm
Expand Up @@ -156,8 +156,13 @@ my role Supply {
self.Channel.list;
}

method for(Supply:U: |c) {
DEPRECATED('from-list',|<2015.01 2016.01>);
SupplyOperations.from-list(|c);
}

method on_demand(Supply:U: |c) { SupplyOperations.on_demand(|c) }
method for(Supply:U: |c) { SupplyOperations.for(|c) }
method from-list(Supply:U: |c) { SupplyOperations.from-list(|c) }
method interval(Supply:U: |c) { SupplyOperations.interval(|c) }
method flat(Supply:D: ) { SupplyOperations.flat(self) }
method grep(Supply:D: Mu $test) { SupplyOperations.grep(self, $test) }
Expand Down
6 changes: 3 additions & 3 deletions src/core/SupplyOperations.pm
Expand Up @@ -69,8 +69,8 @@ my class SupplyOperations is repr('Uninstantiable') {
OnDemandSupply.new(:&producer, :&closing, :$scheduler)
}

method for(*@values, :$scheduler = CurrentThreadScheduler) {
my class ForSupply does Supply {
method from-list(*@values, :$scheduler = CurrentThreadScheduler) {
my class FromListSupply does Supply {
has @!values;
has $!scheduler;

Expand All @@ -93,7 +93,7 @@ my class SupplyOperations is repr('Uninstantiable') {
$sub
}
}
ForSupply.new(:@values, :$scheduler)
FromListSupply.new(:@values, :$scheduler)
}

method interval($interval, $delay = 0, :$scheduler = $*SCHEDULER) {
Expand Down

0 comments on commit 828d0df

Please sign in to comment.