hotstuff_rs::event_bus

Function start_event_bus

source
pub(crate) fn start_event_bus(
    event_handlers: EventHandlers,
    event_subscriber: Receiver<Event>,
    shutdown_signal: Receiver<()>,
) -> JoinHandle<()>
Expand description

Starts the event bus thread, which runs an infinite loop until a shutdown signal is received from the parent thread. In each iteration of the loop, the thread checks if it received any event notifications, and if so, then triggers the execution of the handlers defined for the event.