Expand description
Channel operations for CSP-style concurrency
Channels are the primary communication mechanism between strands. They use May’s mpsc channels with cooperative blocking.
§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.
§Error Handling
Two variants are available for send/receive:
send/receive- Panic on errors (closed channel, invalid ID)send-safe/receive-safe- Return success flag instead of panicking
The safe variants enable graceful shutdown patterns:
value channel-id send-safe if
# sent successfully
else
# channel closed, handle gracefully
thenRe-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;
Structs§
- Channel
Stats - Per-channel statistics for diagnostics
Functions§
- channel_
count - Get the number of open channels (for diagnostics)
- channel_
stats - Get per-channel statistics for all open channels (for diagnostics)
- 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 and remove it from the registry
- patch_
seq_ ⚠make_ channel - Create a new channel