class Tap {}

A Tap is a subscription to a Supply.

my $s = Supplier.new;
my $tap = $s.Supply.on-close({ say "Tap closed" }).tap(
    -> $v { say "the value is $v" },
    done    => { say "Supply is done" },
    quit    => -> $ex { say "Supply finished with error $ex" },
);
 
# later 
$tap.close;

Methods§

method close§

method close(Tap:D:)

Closes the tap.

Typegraph§

Type relations for Tap
raku-type-graph Tap Tap Any Any Tap->Any Mu Mu Any->Mu IO::Socket::Async::ListenSocket IO::Socket::Async::ListenSocket IO::Socket::Async::ListenSocket->Tap

Expand chart above