Event-driven programming

UI events from mice, keyboards, touchpads and touchscreens, and external sensor inputs are common cases.

Event-driven programming is the dominant paradigm used in graphical user interfaces applications and network servers.

Whereas queue / message driven services (e.g. AWS SQS) are coupled with their consumers.

For example, a single left-button mouse-click on a command button in a GUI program may trigger a routine that will open another window, save data to a database or exit the application.

Because event handlers execute in response to external events, correctly structuring the handlers to work when called in any order can require special attention and planning in an event-driven program.