Expand description
Graceful shutdown mechanism for IPC channels
This module provides the GracefulChannel trait for implementing graceful shutdown
in IPC channels, preventing errors like EventLoopClosed when background threads
continue sending messages after the main event loop has closed.
§Example
use ipckit::{NamedPipe, GracefulChannel, GracefulNamedPipe};
use std::time::Duration;
fn main() -> Result<(), ipckit::IpcError> {
let pipe = NamedPipe::create("my_pipe")?;
let graceful = GracefulNamedPipe::new(pipe);
// ... use the channel ...
// Graceful shutdown
graceful.shutdown();
graceful.drain()?; // Wait for pending messages
Ok(())
}Structs§
- Graceful
IpcChannel - IPC channel with graceful shutdown support
- Graceful
Named Pipe - Named pipe with graceful shutdown support
- Graceful
Wrapper - A wrapper that adds graceful shutdown capability to any channel
- Operation
Guard - RAII guard for tracking pending operations
- Shutdown
State - Shutdown state that can be shared between channel instances
Traits§
- Graceful
Channel - Trait for channels that support graceful shutdown