2.8 KiB
2.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T03:24:41.583856+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | f8835260c1874944 |
Realtime
1. Purpose
This module defines the RealtimeChannelSelectedEvent class, a Prism PubSubEvent used to broadcast notifications across the application whenever a realtime communication channel is selected. Its role is to decouple the selection logic (e.g., UI interaction or configuration change) from downstream components (e.g., data handlers, UI panels, or connection managers) that need to react to channel changes—such as updating active subscriptions, switching data streams, or refreshing UI elements tied to the selected channel.
2. Public Interface
RealtimeChannelSelectedEvent- Inherits from:
PubSubEvent<IRealtimeChannel> - Behavior: A concrete event type that carries an
IRealtimeChannelpayload. When published (viaEventAggregator.Publish()), it notifies all subscribers that a new realtime channel has been selected. Subscribers receive the selected channel instance as the event argument.
- Inherits from:
3. Invariants
- The event payload is guaranteed to be non-null at the time of publication, assuming callers follow the intended usage pattern (publishing only when a valid channel is selected).
- The event is strictly asynchronous and loosely coupled—publishing does not block, and subscribers execute independently.
- The event type is immutable by design (no custom logic beyond inheritance); behavior is defined entirely by Prism’s
PubSubEventinfrastructure.
4. Dependencies
- Depends on:
Prism.Events(forPubSubEvent<TPayload>)DTS.Common.Interface.Realtime(forIRealtimeChannelinterface)
- Depended upon by:
- Any component that needs to react to realtime channel selection changes (e.g., UI views, service layers managing subscriptions). Specific dependents are not visible in this file but would typically subscribe via
EventAggregator.GetEvent<RealtimeChannelSelectedEvent>().Subscribe(...).
- Any component that needs to react to realtime channel selection changes (e.g., UI views, service layers managing subscriptions). Specific dependents are not visible in this file but would typically subscribe via
5. Gotchas
- No null-safety enforcement: While the event payload is expected to be non-null, Prism’s
PubSubEventdoes not enforce this. Callers must ensure only validIRealtimeChannelinstances are published. - Lifetime management: Subscribers must manually unsubscribe (e.g., in
Disposeor view cleanup) to avoid memory leaks—especially for long-lived subscribers (e.g., services) subscribing to this short-lived event. - No ordering guarantees: Multiple subscribers execute in an undefined order; if sequential logic is required (e.g., cleanup before setup), explicit coordination is needed.
- None identified from source alone.