Atom

Channels

A channel is a bounded queue for passing copied messages between tasks. A sender puts a value in the queue, and a receiver takes the next one.

Send and receive one message

A capacity of one is enough for this example.

Atom
use task

queue = task.channel(1)
try:
    task.send(queue, 'ready')
    message = task.receive(queue)
    print(message.value)
finally:
    task.close(queue)
Output
ready

The receive operation returns a record with the sent value. Finally closes the queue.