Function send_command

Source
fn send_command(
    command: InternalCommand,
    tx_to_thread_opt: Option<&mut AquaSender<InternalCommand>>,
    rx_from_thread_opt: Option<&mut AquaReceiver<bool>>,
    thread_name: &str,
)
Expand description

Sends a specified InternalCommand to a target thread’s channel and optionally waits for an acknowledgment.

The signal handler uses this helper function to communicate termination or other control commands to various application threads. It attempts to send the command and, if a receiver channel is provided, waits for a boolean acknowledgment to confirm the command was processed.

§Arguments

  • command - The InternalCommand to be sent to the target thread.
  • tx_to_thread_opt - An Option containing the sender part of the channel for communication to the target thread. If None, no command is sent.
  • rx_from_thread_opt - An Option containing the receiver part of the channel for communication from the target thread, used to receive an acknowledgment. If None, no acknowledgment is expected or waited for.
  • thread_name - The name of the target thread (for logging and debugging purposes).