pub trait AcknowledgeSignalHandlerTrait {
// Required methods
fn send_true_to_signal_handler(&mut self) -> Result<(), AquaChannelError>;
fn location(&self) -> String;
// Provided method
fn acknowledge_signal_handler(&mut self) { ... }
}Expand description
A trait for objects that can send a shutdown acknowledgment to the SignalHandler.
This trait abstracts the boilerplate logic required for a thread to confirm that it has
received a Quit command and is ready to terminate. By implementing this trait on a
module’s channel struct, the module can simply call acknowledge_signal_handler()
to handle the confirmation and logging automatically.
Required Methods§
Sourcefn send_true_to_signal_handler(&mut self) -> Result<(), AquaChannelError>
fn send_true_to_signal_handler(&mut self) -> Result<(), AquaChannelError>
Sends the raw acknowledgment message (true) to the SignalHandler.
This method must be implemented by any struct that uses the trait. It is responsible for the actual send-operation to the channel.
Provided Methods§
Sourcefn acknowledge_signal_handler(&mut self)
fn acknowledge_signal_handler(&mut self)
Acknowledges the SignalHandler by sending a confirmation message.
This is the primary method that threads should call during shutdown.
It wraps the call to send_true_to_signal_handler with error handling,
automatically logging a detailed error message if the sending to the channel fails.