Skip to content

Instantly share code, notes, and snippets.

@autarch
Created November 27, 2015 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autarch/5ddae1da5bce447d45f4 to your computer and use it in GitHub Desktop.
Save autarch/5ddae1da5bce447d45f4 to your computer and use it in GitHub Desktop.
my $sched = ThreadPoolScheduler
.new( :max_threads($!threads) );
my $supply = $items.values.Supply;
$supply.schedule-on($sched);
my $i = 1;
$supply.tap(
sub ($item) {
$sub($item);
$prog.update($i++);
}
);
$supply.done;
$prog.message($msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment