Anonymous user
Metered concurrency: Difference between revisions
m
→{{header|Perl 6}}: spelling
m (→{{header|Perl 6}}: use xx rather than for loop) |
m (→{{header|Perl 6}}: spelling) |
||
Line 1,025:
{{works with|Rakudo/JVM|2013-11-24}}
Uses a buffered channel to hand out a limited number of tickets.
<lang perl6>class
has $.tickets = Channel.new;
method new ($max) {
Line 1,037:
sub MAIN ($units = 5, $max = 2) {
my $sem =
my @units = do for ^$units -> $u {
|