Interface ISupportCaseNotifier
- Namespace
- Tharga.Team
- Assembly
- Tharga.Team.dll
Tells the host when a support case changed, whichever side changed it.
public interface ISupportCaseNotifier
Remarks
A singleton, and it has to be one. A reply arriving from Slack is handled in the inbound
endpoint's own request scope; a page waiting to render it lives in a Blazor circuit's scope. An event
raised on a scoped service reaches only the instance that raised it, so the two would never meet. Putting
the event on ISupportCaseService looks natural and silently does nothing across scopes.
Handlers run on whichever thread raised the event — for an inbound reply that is a request thread
handling a Slack POST, not a Blazor circuit. A component must marshal with InvokeAsync before
touching its own state, or it will update off the circuit's synchronization context and either lose the
render or throw.
Unsubscribe. This outlives every page that listens to it, so a component that subscribes and never
detaches keeps itself alive for the lifetime of the application. Subscribe in OnInitialized,
unsubscribe in Dispose.
It carries no authorization. Every subscriber is told about every case in every team, because filtering here would need a caller and a singleton has none. A handler that acts on the notification must read the case back through ISupportCaseService, where the checks are.
It reaches this instance only. On several instances a host relays over its own backplane: it publishes
each notification whose FromRemote is false, and calls
Notify(SupportCaseUpdatedEventArgs) with FromRemote set for what arrives from the other instances. Every view listening
here then shows changes made anywhere.
Methods
Notify(SupportCaseUpdatedEventArgs)
Announces a change. Called by the toolkit, and by a host relaying a change made on another instance with FromRemote set.
void Notify(SupportCaseUpdatedEventArgs args)
Parameters
Events
CaseUpdated
Raised after a case is created, replied to or closed.
event EventHandler<SupportCaseUpdatedEventArgs> CaseUpdated