Expand description
Channel operations for CSP-style concurrency
Channels are the primary communication mechanism between strands. They use May’s MPMC channels with cooperative blocking.
§Zero-Mutex Design
Channels are passed directly as Value::Channel on the stack. There is NO
global registry and NO mutex contention. Send/receive operations work directly
on the channel handles with zero locking overhead.
§Non-Blocking Guarantee
All channel operations (send, receive) cooperatively block using May’s scheduler.
They NEVER block OS threads - May handles scheduling other strands while waiting.
§Multi-Consumer Support
Channels support multiple producers AND multiple consumers (MPMC). Multiple strands can receive from the same channel concurrently - each message is delivered to exactly one receiver (work-stealing semantics).
§Stack Effects
chan.make: ( – Channel ) - creates a new channelchan.send: ( value Channel – ) - sends value through channelchan.receive: ( Channel – value ) - receives value from channel
§Error Handling
Two variants are available for send/receive:
send/receive- Panic on errors (closed channel)send-safe/receive-safe- Return success flag instead of panicking
Re-exports§
pub use patch_seq_chan_receive as receive;pub use patch_seq_chan_receive_safe as receive_safe;pub use patch_seq_chan_send as send;pub use patch_seq_chan_send_safe as send_safe;pub use patch_seq_close_channel as close_channel;pub use patch_seq_make_channel as make_channel;
Functions§
- patch_
seq_ ⚠chan_ receive - Receive a value from a channel
- patch_
seq_ ⚠chan_ receive_ safe - Receive a value from a channel, with error handling
- patch_
seq_ ⚠chan_ send - Send a value through a channel
- patch_
seq_ ⚠chan_ send_ safe - Send a value through a channel, with error handling
- patch_
seq_ ⚠close_ channel - Close a channel (drop it from the stack)
- patch_
seq_ ⚠make_ channel - Create a new channel