Skip to main content

Module event

Module event 

Source

Structs§

EventQueue
A queue of events that can be formatted and displayed. This is a newtype wrapper around Vec<SpotEvent> that provides better formatting support.

Enums§

SpotEvent

Traits§

EventBackend

Functions§

clear_events
Clears all events from the event queue without returning them.
drain_events
Drains all events from the event queue and returns them. This clears the queue after draining. Useful for retrieving events after operations complete.
emit_event
Called from anywhere (engine, core logic) to emit an event. This stores the event in the event queue. Use publish_events() to actually send them.
init_event_bus
Call once at process startup to create the dispatcher thread.
publish_event_queue
Publishes an EventQueue to the event bus (if initialized). This is useful when you have an EventQueue returned from an operation.
publish_events
Publishes all events from the global queue to the event bus (if initialized). After publishing, the queue is drained and cleared.
register_backend
Register a backend; returns an mpsc::Receiver<SpotEvent> that you can consume from a dedicated thread.