golang's sys.WaitGroup in perl6
Perl6
Latest commit 1313575 Dec 7, 2016 @skaji send Nil
Permalink
Failed to load latest commit information.
eg init Dec 7, 2016
lib send Nil Dec 7, 2016
t init Dec 7, 2016
.gitignore init Dec 7, 2016
.travis.yml init Dec 7, 2016
LICENSE init Dec 7, 2016
META6.json lock Dec 7, 2016
README.md lock Dec 7, 2016

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.