EventQueue
EventQueue is a fundamental component of event-driven programming in GUI systems. It is a data structure and coordinating mechanism that holds events until they can be processed by the program’s event loop. Events may be generated by user input (mouse, keyboard), timers, system notifications, or inter-thread communication. An event queue is typically a first-in, first-out (FIFO) queue, sometimes with support for prioritization or coalescing of related events, and it is designed to be thread-safe so producers from multiple threads can enqueue events.
In Java’s AWT and Swing ecosystems, the EventQueue is responsible for dispatching events to the appropriate
Cross-platform there are similar constructs: Android uses a Looper and MessageQueue to schedule and dispatch messages