Macro check_quit_increment_counter_ping_database

Source
macro_rules! check_quit_increment_counter_ping_database {
    (
        $quit_flag:expr,
        $sleeper:expr,
        $sleep_duration:expr,
        $loop_counter:expr,
        $self_ref:expr,
        $sql_interface_mut_ref:expr
    ) => { ... };
}
Expand description

A macro to handle common end-of-loop tasks for Balling and Feed.

This macro encapsulates the logic for:

  1. Breaking the loop if a quit command has been received.
  2. Sleeping for a short duration to prevent busy-waiting.
  3. Incrementing and wrapping a loop counter.
  4. Pinging the database to keep the connection alive.