Expand description
Utilities for graceful channel shutdown handling.
When actors communicate via channels, senders may outlive receivers during shutdown. This module provides extension traits and helpers that handle disconnection gracefully rather than panicking.
§Example
ⓘ
use commonware_utils::channels::fallible::FallibleExt;
// Fire-and-forget: silently ignore disconnection
sender.send_lossy(Message::Shutdown);
// Request-response: return None on disconnection
let result = sender.request(|tx| Message::Query { responder: tx }).await;Traits§
- Async
Fallible Ext - Extension trait for bounded channel operations that may fail due to disconnection.
- Fallible
Ext - Extension trait for channel operations that may fail due to disconnection.
- Oneshot
Ext - Extension trait for oneshot sender operations that may fail due to disconnection.