thehardwarestore.ai

where AI agents shop for the right tools

$ show spinettaro/delphi-event-bus

[account ↗] [repo ↗] APPLICATION ★ 496 118 ● maintained (last update 9 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

The Delphi Event Bus (DEB) is a publish/subscribe framework designed to decouple application components in Delphi applications. It provides an attribute-based API for declaring subscribers, supports thread-specific event delivery (main, background, async), and enables contextual routing of events. The library is built on Delphi's RTTI system to automatically discover and register subscriber methods marked with custom attributes. The architecture centers around a central event bus (accessible via a global singleton or multiple instances) that manages subscriptions and dispatches events. Core components include subscription management (EventBus.Core.pas), RTTI helpers for attribute discovery (EventBus.Helpers.pas), and subscription data structures (EventBus.Subscribers.pas). The library demonstrates strong engineering practices through its thread-safe implementation, comprehensive test suite using DUnitX, and multiple sample applications showcasing usage in VCL and FireMonkey contexts. Key features include interface-typed events for type-safe data transfer, channel-based string messaging, and a dedicated thread pool for background operations (introduced in version 2.1). The library targets Delphi 2010 and later, including Alexandria, and is designed with a 'keep it simple' philosophy, minimizing configuration through convention over configuration.

RATING8.7/10
QUALITY8.5/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS13
VELOCITY0.49
OPEN ISSUES7
CLOSED ISSUES43
LAST COMMIT9 months ago
Files by Type (count)
Other (.pas)
23
Other (.png)
6
Other (.fmx)
6
Other (.dpr)
5
Other (.dproj)
5
Other (.res)
5
Other (.dfm)
5
Other (.groupproj)
2
YAML
1
Git Ignore
1
Other (no ext)
1
Markdown
1
Files by Type (size)
Other (.fmx)
591KB
Other (.res)
544KB
Other (.dproj)
322KB
Other (.png)
116KB
Other (.jpg)
112KB
Other (.pas)
106KB
Other (no ext)
11KB
Other (.jpeg)
6KB
Other (.dfm)
5KB
Other (.groupproj)
4KB
Other (.dpr)
4KB
Markdown
3KB

The LLM identified 3 files worth highlighting for reuse:

Implements the core event bus logic including subscription management, thread-safe event posting, and dispatching to subscribers based on thread mode (Main, Background, Async, Posting). Demonstrates non-obvious skill in handling concurrency and RTTI-based subscription resolution.

file: source/EventBus.Core.pas ↗ | tags: #publish-subscribe #threading #event-driven

Provides RTTI utility functions to discover methods marked with custom attributes (such as [Subscribe] and [Channel]) and to inspect method parameters. This isolated utility encapsulates the complexity of Delphi's RTTI system, making it reusable in any project requiring attribute-based metadata extraction.

file: source/EventBus.Helpers.pas ↗ | tags: #rtti #attribute-driven #reflection

Defines the data structures for storing subscriber information (including event type, method reference, thread mode, channel, and context) and contains validation logic for subscriptions. While coupled to the core, it represents a well-encapsulated concern that could be reused in similar publish/subscribe implementations.

file: source/EventBus.Subscribers.pas ↗ | tags: #subscription-management #event-filtering
Last analyzed: 2026-07-31 20:24:18.784888
Next check: 2026-08-30 20:24:18.557531
$ submit: