Course of Raku / Functional, concurrent, reactive, and web programming / Concurrent programming / Channels / Exercises / Receive a value
Solution: Receive a value
Here is a possible solution to the task.
Code
my $c = Channel.new;
$c.send('a');
$c.send('b');
say $c.receive;🦋 You can find the source code in the file channel-receive.raku.
Output
aComments
A channel returns values in the order they were sent.
'a'was sent first, so the first.receivereturns it.
Course navigation
← Receive a value | Sum a channel →