Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Supply.throttle control message is now key:value
Rather than using a Pair (which is awkward to use in an .emit anyway,
because you need extra parens to not make it a named parameter), we
now use a string of the form "key:value".  This should *also* make it
much easier to use Supply.throttle as a means of controlling supply
processing across multiple machines.
  • Loading branch information
lizmat committed Oct 21, 2015
1 parent 9fbd04d commit 009400e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/Supply.pm
Expand Up @@ -859,8 +859,9 @@ my role Supply {
$control
?? ($control => {
emit => -> \val {
my $type = val.key;
my $value = val.value;
my str $type;
my str $value;
Rakudo::Internals.KEY_COLON_VALUE(val,$type,$value);

if $type eq 'limit' {
my int $extra = $value - $limit;
Expand Down Expand Up @@ -945,8 +946,9 @@ my role Supply {
$control
?? ($control => {
emit => -> \val {
my $type = val.key;
my $value = val.value;
my str $type;
my str $value;
Rakudo::Internals.KEY_COLON_VALUE(val,$type,$value);

if $type eq 'limit' {
$allowed = $allowed + $value - $limit;
Expand Down

0 comments on commit 009400e

Please sign in to comment.