golang's sys.WaitGroup in perl6
Perl6
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
eg
lib send Nil Dec 7, 2016
t
.gitignore init Dec 7, 2016
.travis.yml
LICENSE init Dec 7, 2016
META6.json
README.md

README.md

Build Status

NAME

WaitGroup - sys.WaitGroup in perl6

SYNOPSIS

use WaitGroup;
use HTTP::Tinyish;

my $wg = WaitGroup.new;

my @url = <
    http://www.golang.org/
    http://www.google.com/
    http://www.somestupidname.com/
>;

for @url -> $url {
    $wg.add(1);
    start {
        LEAVE $wg.done;
        my $res = HTTP::Tinyish.new.get($url, :bin);
        note "-> {$res<status>}, $url";
    };
}

$wg.wait;

DESCRIPTION

WaitGroup waits for a collection of promises to finish like sys.WaitGroup in golang.

SEE ALSO

https://golang.org/pkg/sync/#WaitGroup

AUTHOR

Shoichi Kaji skaji@cpan.org

COPYRIGHT AND LICENSE

Copyright 2016 Shoichi Kaji

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.