In Channel§

See primary documentation in context for method closed

method closed(Channel:D: --> Promise:D)

Returns a promise that will be kept once the channel is closed by a call to method close.

my $c = Channel.new;
$c.closed.then({ say "It's closed!" });
$c.close;
sleep 1;