[PASO 2.14] Add EventBus module (CORE #16)#38
Merged
Conversation
Define the public contract for the EventBus module (CORE #16): DomainEvent<T>, EventHandler<T>, EventFilter, QueueStatus, FlushResult, EventBusOptions, EventBusConfig, EVENT_BUS_CONFIG.
…d signal support Implement central event bus service with publish, subscribe, subscribePattern (wildcard/RegExp), stream (Observable), signal (via runInInjectionContext), history (stub) and destroy methods. 19 unit tests covering all API surface.
…geService Implement event queue with enqueue (bounded by maxQueueSize), flush (delivers all pending via EventBusService), status and pending as reactive Signals. Persists to localStorage via StorageService. 14 unit tests.
Implement event history service with add (bounded by historySize), query (filter by type, source, since with AND logic), clear and size methods. Default capacity 100 events. 15 unit tests.
- Create provideEventBus(options?) with makeEnvironmentProviders() - Resolve EventBusOptions → EventBusConfig with sensible defaults - Register EVENT_BUS_CONFIG, EventBusService, EventQueueService, EventHistoryService - Add event-bus/index.ts barrel with typed exports - Re-export event-bus module from packages/core/src/index.ts - 6 new tests (832 total, 0 failures)
- Version bump 0.14.0 → 0.15.0 in package.json - Add CHANGELOG entry for 0.15.0 documenting EventBus module (CORE #16) - Update compare links for [Unreleased] and [0.15.0]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
provideEventBus(options?)factory with configurable queue and historyEventBusService— typedDomainEvent<T>publish/subscribe with wildcard pattern matching,stream()(Observable) andsignal()(Signal) APIsEventQueueService— persistent event queue backed by StorageService (localStorage)EventHistoryService— in-memory ring buffer with filtered queries (type, source, since)STEPs included
Test plan
dist/packages/core/package.jsonshows version 0.15.0@fireflyframework/core