Skip to content

Latest commit

 

History

History
82 lines (51 loc) · 6.87 KB

File metadata and controls

82 lines (51 loc) · 6.87 KB
graph LR
    Signal_Definition_State["Signal Definition & State"]
    Signal_Registry["Signal Registry"]
    Receiver_Connection_Manager["Receiver Connection Manager"]
    Event_Dispatcher["Event Dispatcher"]
    Receiver_Filtering_Iteration["Receiver Filtering & Iteration"]
    Signal_Registry -- "Creates/Retrieves" --> Signal_Definition_State
    Receiver_Connection_Manager -- "Manages Connections For" --> Signal_Definition_State
    Event_Dispatcher -- "Dispatches Events Through" --> Signal_Definition_State
    Event_Dispatcher -- "Requests Active Receivers From" --> Receiver_Filtering_Iteration
    Receiver_Filtering_Iteration -- "Accesses Internal State Of" --> Signal_Definition_State
    click Signal_Registry href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/blinker/Signal_Registry.md" "Details"
    click Receiver_Connection_Manager href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/blinker/Receiver_Connection_Manager.md" "Details"
    click Event_Dispatcher href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/blinker/Event_Dispatcher.md" "Details"
Loading

CodeBoardingDemoContact

Details

The blinker architecture is designed around a clear event-driven paradigm, making it ideal for decoupled communication within Python applications. The Signal Definition & State component is central, acting as the event channel that maintains connections to various receivers. The Signal Registry provides a centralized mechanism for creating and retrieving these signals, ensuring consistency. Receivers establish their interest in specific signals via the Receiver Connection Manager, which handles the intricate details of linking and unlinking. When an event occurs, the Event Dispatcher takes charge, orchestrating the notification process by iterating through active listeners provided by the Receiver Filtering & Iteration component. This modular design facilitates a clean flow of events from senders to multiple, independently managed receivers, making it highly suitable for visual representation as a flow graph where signals are the conduits of information.

Signal Definition & State

The fundamental entity representing a distinct event or communication channel. It encapsulates the internal state required to manage connected receivers and senders, including weak references for automatic cleanup.

Related Classes/Methods:

Signal Registry [Expand]

A global factory and registry responsible for creating and retrieving Signal instances, particularly named ones. This ensures that for a given name, a unique Signal object is always returned, facilitating signal discovery and reuse across an application.

Related Classes/Methods:

Receiver Connection Manager [Expand]

This component handles the entire lifecycle of connecting and disconnecting receiver functions to specific signals. It supports various paradigms for subscription, including direct function calls, decorator-based connections, and context-managed temporary connections. It also manages the weak referencing of receivers and senders to facilitate automatic cleanup.

Related Classes/Methods:

Event Dispatcher [Expand]

The core mechanism responsible for triggering the execution of all receivers connected to a specific signal when that signal is "sent." It iterates through the active receivers and invokes them, handling both synchronous and asynchronous receiver functions.

Related Classes/Methods:

Receiver Filtering & Iteration

An internal utility that provides an iterable of currently active and valid receiver functions for a given signal and sender. It plays a crucial role in filtering out "dead" weak references (receivers or senders that have been garbage collected) before dispatch.

Related Classes/Methods: