Skip to content

SignalR Notification Contract

SignalR notification contract

The Deck uses SignalR as a real-time notification layer. SignalR is not the source of truth; SQL storage is. SignalR tells connected dashboards that something changed and which UI areas should refresh or update.

Where It Lives

Runtime typeRole
IChokaQNotifierRuntime notification contract.
ChokaQSignalRNotifierSignalR implementation that sends events to clients.
ChokaQHubBidirectional hub for dashboard commands and live updates.

Events

EventMeaning
JobUpdatedActive job status changed.
JobProgressHandler reported progress.
JobArchivedJob moved to successful history.
JobFailedJob moved to DLQ.
JobResurrectedDLQ job moved back to active work.
JobsPurgedJobs were permanently deleted.
QueueStateChangedQueue pause/resume changed.
StatsUpdatedDashboard counters should refresh.

Correctness Boundary

SignalR messages can be delayed, dropped by disconnects, or observed out of order by a browser. That is acceptable because the dashboard can always reload authoritative state from storage.

The event contract should be treated as a UI invalidation protocol, not as a durable event stream.

Architecture Decision

Why this pattern?

Operators need low-latency feedback when jobs move, fail, resurrect, or purge. SignalR fits interactive dashboard updates without adding a separate broker.

Trade-offs

SignalR requires connected clients and authorization on the hub. It does not replace storage reads or metrics. Dashboard code must tolerate reconnects and refresh from storage.

Alternatives considered

AlternativeBenefitCost
Polling onlySimple and robust.Slower operator feedback and more periodic reads.
External pub/subDurable fanout possible.Extra infrastructure for dashboard invalidation.
Browser refresh onlyMinimal code.Poor incident workflow.

Additional Questions

Is SignalR authoritative?
No. SQL is authoritative. SignalR is a notification and invalidation layer.

What happens if a client misses an event?
The next refresh or explicit storage query returns authoritative state.

Why not use a broker?
For dashboard invalidation, SignalR is enough and avoids adding infrastructure.

Apache 2.0 Licensed