send
ErrorsCollection

send

Synthesised documentation from type/Channel

From type/Channel

See Original text in context

method send(Channel:D: \item)

Enqueues an item into the Channel. Throws an exception of type X::Channel::SendOnClosed if the channel has been closed already. This call will not block waiting for a consumer to take the object. There is no set limit on the number of items that may be queued, so care should be taken to prevent runaway queueing.

my $c = Channel.new;
$c.send(1);
$c.send([2345]);
$c.close;
say $c.list# OUTPUT: «(1 [2 3 4 5])␤»