Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Let's try to do this another way
This reverts commit 9a1c529.
  • Loading branch information
lizmat committed Jul 10, 2014
1 parent 9a1c529 commit ef8137f
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/core/SupplyOperations.pm
Expand Up @@ -124,14 +124,14 @@ my class SupplyOperations is repr('Uninstantiable') {
method flat(Supply $source) {
my class FlatSupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;

submethod BUILD(:$!source) { }

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap( -> \val {
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap( -> \val {
self!more(val.flat)
},
done => { self!done(); },
Expand All @@ -145,15 +145,15 @@ my class SupplyOperations is repr('Uninstantiable') {
method grep(Supply $source, Mu $test) {
my class GrepSupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has Mu $!test;

submethod BUILD(:$!source, :$!test) { }

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap( $!test.DEFINITE
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap( $!test.DEFINITE
?? $!test ~~ Callable
?? $!test ~~ Regex
?? -> \val { self!more(val) if val.match($!test) }
Expand All @@ -172,15 +172,15 @@ my class SupplyOperations is repr('Uninstantiable') {
method map(Supply $source, &mapper) {
my class MapSupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has &!mapper;

submethod BUILD(:$!source, :&!mapper) { }

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap( -> \val {
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap( -> \val {
self!more(&!mapper(val))
},
done => { self!done(); },
Expand All @@ -194,15 +194,15 @@ my class SupplyOperations is repr('Uninstantiable') {
method schedule_on(Supply $source, Scheduler $scheduler) {
my class ScheduleSupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has $!scheduler;

submethod BUILD(:$!source, :$!scheduler) { }

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap( -> \val {
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap( -> \val {
$!scheduler.cue: { self!more(val) }
},
done => { $!scheduler.cue: { self!done(); } },
Expand Down Expand Up @@ -246,7 +246,6 @@ my class SupplyOperations is repr('Uninstantiable') {

my class StableSupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has $!time;
has $!scheduler;
has $!lock;
Expand All @@ -258,8 +257,9 @@ my class SupplyOperations is repr('Uninstantiable') {

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap(
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap(
-> \val {
$!lock.protect({
if $!last_cancellation {
Expand Down Expand Up @@ -289,16 +289,16 @@ my class SupplyOperations is repr('Uninstantiable') {

my class DelaySupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has $!time;
has $!scheduler;

submethod BUILD(:$!source, :$!time, :$!scheduler) { }

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap(
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap(
-> \val {
$!scheduler.cue( { self!more(val) }, :in($time) );
},
Expand All @@ -317,7 +317,6 @@ my class SupplyOperations is repr('Uninstantiable') {
method migrate(Supply $source) {
my class MigrateSupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has $!current;
has $!lock;

Expand All @@ -327,8 +326,9 @@ my class SupplyOperations is repr('Uninstantiable') {

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap(
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap(
-> \inner_supply {
X::Supply::Migrate::Needs.new.throw
unless inner_supply ~~ Supply;
Expand All @@ -350,7 +350,6 @@ my class SupplyOperations is repr('Uninstantiable') {
method classify(Supply $source, &mapper, :$multi ) {
my class ClassifySupply does Supply does PrivatePublishing {
has $!source;
has $!source-tap;
has %!mapping;

submethod BUILD(:$!source) { }
Expand All @@ -364,8 +363,9 @@ my class SupplyOperations is repr('Uninstantiable') {

method live { $source.live }
method tap(|c) {
my $tap = self.Supply::tap(|c, closing => {$!source-tap.close});
$!source-tap //= $!source.tap( $multi
my $source_tap;
my $tap = self.Supply::tap(|c, closing => {$source_tap.close});
$source_tap = $!source.tap( $multi
?? -> \val {
for @(mapper(val)) -> $key {
self.find_supply($key).more(val);
Expand Down

0 comments on commit ef8137f

Please sign in to comment.