# New Ticket Created by  刘刊 
# Please include the string:  [perl #128906]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128906 >


As shown below, of the 3 consecutive times the following code was run, 2 hung.
the results produced didn't make sense either, unless I misunderstood how 
throttle should work.

8< ======================= 8<

use v6;

my $s = Supply.from-list(^6);
my $t = $s.throttle: 3, { sleep 3; $_ };

$t.act: -> $v { $v.result.say };
$t.wait

8< ======================= 8<

liukan@candor:~/Code$ time perl6 foo
0
1
2
3
4
5
0

real    0m6.188s
user    0m0.160s
sys    0m0.036s
liukan@candor:~/Code$ time perl6 foo
0
1
2
3
4
5
1
^C

real    0m33.380s
user    0m0.128s
sys    0m0.012s
liukan@candor:~/Code$ time perl6 foo
2
0
3
4
5
0
^C

real    0m33.155s
user    0m0.128s
sys    0m0.032s
liukan@candor:~/Code$

liukan@candor:~/Code$ perl6 -v
This is Rakudo version 2016.07.1 built on MoarVM version 2016.07
implementing Perl 6.c.

liukan@candor:~/Code$ uname -a
Linux candor 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 
x86_64 x86_64 x86_64 GNU/Linux

Reply via email to