Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Seems removing the paused functionality regresses
Specifically the classify/categorize tests.  Guess I need to fix those first
before removing this functionality.  On the other hand, I don't really see
how I can do that just yet.  So reverting.

This reverts commit 592a2ed.
  • Loading branch information
lizmat committed Jul 11, 2014
1 parent 2c957ff commit 8a0a8f9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/core/Supply.pm
Expand Up @@ -18,10 +18,19 @@ my class Tap {
my role Supply {
has $!tappers_lock = Lock.new;
has @!tappers;
has $!been_tapped;
has @!paused;

method tap(Supply:D: &more = -> $ { }, :&done,:&quit={die $_},:&closing) {
my $tap = Tap.new(:&more, :&done, :&quit, :&closing, :supply(self));
$!tappers_lock.protect({ @!tappers.push($tap) });
$!tappers_lock.protect({
@!tappers.push($tap);
if @!paused -> \todo {
$tap.more().($_) for todo;
@!paused = ();
}
$!been_tapped = True;
});
$tap
}

Expand All @@ -47,6 +56,9 @@ my role Supply {
if self.tappers -> \tappers {
.more().(msg) for tappers;
}
elsif !$!been_tapped {
$!tappers_lock.protect({ @!paused.push: msg });
}
Nil;
}

Expand Down

0 comments on commit 8a0a8f9

Please sign in to comment.