Event Driven Programming
Table of Contents
1. Abstract
The event-driven paradigm is readily observable in graphical user interfaces (GUIs) where actions like clicks and submissions trigger specific responses. This contrasts with traditional verification-based systems that rely on continuous polling.
Event-driven architecture centers around a main loop (often termed a "listener") which remains dormant until an event occurs. Upon triggering, the listener executes pre-defined functions known as event handlers, hooks, or callbacks. This mechanism can be implemented at the hardware level using interrupts, particularly in embedded systems.
Higher-level programming languages offer abstractions for elegant event handling. Asynchronous programming constructs like "await" (often paired with "async") and closures (also known as lambdas) streamline event-driven code.