Skip to content

Event-Driven Programming

  Event-driven programming is a paradigm in which the flow of a program is determined by events. These events can be generated by both internal and external actions, such as user interactions (mouse clicks, keyboard inputs, etc), system-generated signals (timers, network messages, etc), or other internal processes.

  In the context of Pyventus, event handling is based on the Publisher-Subscriber pattern1, which is an event-driven model where events can be published by one or more sources and consumed by one or more subscribers. This design enables different parts of an application to communicate effectively without needing to be aware of each other.

  What makes Pyventus unique is its distinctive approach to the Publisher-Subscriber pattern. While it provides features similar to traditional event emitter libraries, it also leverages Python's unique characteristics. Pyventus allows you to organize your code around discrete events and their responses in a centralized manner across different contexts, as well as control their emission, propagation, and processing.


  1. For further reading about the Publisher-Subscriber pattern, you can refer to the Publish–subscribe pattern on Wikipedia.