Next: Timers, Previous: Operations, Up: Fibers [Contents][Index]
Channels are the way to communicate between fibers. To use them, load
the (fibers channels)
module.
Make a fresh channel.
Return #t
if obj is a channel, or #f
otherwise.
Make an operation that if and when it completes will rendezvous with a receiving operation to send message over channel.
Make an operation that if and when it completes will rendezvous with a sending operation to receive one value from channel.
Send message on channel, and return zero values. If there is already a receiver waiting to receive a message on this channel, give it our message and continue. Otherwise, block until a receiver becomes available.
Equivalent to:
(perform-operation (put-operation channel message))
Receive a message from channel and return it. If there is already a sender waiting to send a message on this channel, take its message directly. Otherwise, block until a sender becomes available.
Equivalent to:
(perform-operation (get-operation channel))