Skip to content

feat(context): injectable ApplicationEventPublisher + arbitrary domain events (v26.06.41)#68

Merged
ancongui merged 2 commits into
mainfrom
feat/application-event-publisher
Jun 7, 2026
Merged

feat(context): injectable ApplicationEventPublisher + arbitrary domain events (v26.06.41)#68
ancongui merged 2 commits into
mainfrom
feat/application-event-publisher

Conversation

@ancongui
Copy link
Copy Markdown
Contributor

@ancongui ancongui commented Jun 7, 2026

Injectable ApplicationEventPublisher singleton (Spring's ApplicationEventPublisher): inject it + await publisher.publish(event) to fire events into the context bus. The bus and @app_event_listener now accept any object (not just ApplicationEvent subclasses) — a listener whose parameter type matches by isinstance receives it; an untyped/Any param still falls back to the catch-all ApplicationEvent. Tests (2): inject publisher → fire a domain event → listener receives it; publisher is a singleton bean. Gates: mypy --strict (619), ruff+format, full suite 3822.

Andrés Contreras Guillén added 2 commits June 7, 2026 13:38
…n events + bump v26.06.41

- ApplicationEventPublisher is now an injectable singleton bean (Spring ApplicationEventPublisher);
  inject it + await publisher.publish(event) to fire events into the context bus.
- The event bus + @app_event_listener accept ANY object (not just ApplicationEvent subclasses);
  a listener whose param type matches (isinstance) receives it. Untyped/Any param still falls back
  to the catch-all ApplicationEvent (note: typing.Any is a class in 3.11+, excluded explicitly).

Tests: tests/context/test_event_publisher.py (2). Gates: mypy --strict (619), ruff + format,
full suite 3822 passed.
@ancongui ancongui merged commit 43c84a7 into main Jun 7, 2026
5 checks passed
@ancongui ancongui deleted the feat/application-event-publisher branch June 7, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant