chickadee » gochan » gochan-receive

gochan-receive chans #!optional timeout/secondsprocedure

chans is a single gochan or a list of gochans. Pops next msg from any of chans' buffers in a thread-safe manner, if possible. Otherwise, if channel is empty, wait for a gochan-send from another thread. If timeout is supplied and is reached, or all channels are empty and closed, an error is thrown.

If multiple channels in chans have messages available, the message from the first channel is popped first.

If you have multiple threads waiting messages from the same gochan, the order in which threads receive messages is unspecified (but each message is received only once).