Help language development. Donate to The Perl Foundation

Channel::Pauseable cpan:THINCH last updated on 2019-09-02

examples/supply-list(infinite supply).p6
#!/usr/bin/env perl6

use v6;
use Channel::Pauseable;

my $channel = Channel::Pauseable.new;

my $supply = Supply.interval(1);

my $tap = $channel.tap($supply);

Promise.in(10).then({ say "Stopping!"; $tap.close });

for $channel.list -> $r {
    say $r;
}

# vim:nospell