Skip Menu |
Report information
Id: 128906
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: liukan [at] 360.cn
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
Subject: [BUG] Supply .throttle hangs/wrong results
From: 刘刊 <liukan [...] 360.cn>
Date: Fri, 12 Aug 2016 06:00:17 +0000
Download (untitled) / with headers
text/plain 1012b
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
Subject: [perl #128906]
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
From: 刘刊 <liukan [...] 360.cn>
Date: Fri, 12 Aug 2016 07:35:15 +0000
Download (untitled) / with headers
text/plain 2.9k
Download (untitled) / with headers
text/html 24.3k

Message body is not shown because it is too large.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org