Skip to content

EventDispatcher Class

Fans one security event out to the streams it belongs on: for every stream it checks the status, the delivered event types, the subject coverage (SSF 1.0 Section 8.1.3.1) and - last - the sharing policy (Section 9.2), then mints a per-stream SET and hands it to the stream's outbox. Delivery itself is someone else's clock: a sender drains the outbox for enabled streams, and a paused stream's events simply wait.

C#
public sealed class EventDispatcher

Inheritance System.Object → EventDispatcher

Constructors

EventDispatcher(ILogger<EventDispatcher>, IStreamStore, IEventOutbox, ISecurityEventTokenSigner, string, IEventSharingPolicy, IEventPayloadPolicy, TimeProvider) Constructor

Fans one security event out to the streams it belongs on: for every stream it checks the status, the delivered event types, the subject coverage (SSF 1.0 Section 8.1.3.1) and - last - the sharing policy (Section 9.2), then mints a per-stream SET and hands it to the stream's outbox. Delivery itself is someone else's clock: a sender drains the outbox for enabled streams, and a paused stream's events simply wait.

C#
public EventDispatcher(Microsoft.Extensions.Logging.ILogger<Abblix.SharedSignals.Transmitter.EventDispatcher> logger, Abblix.SharedSignals.Transmitter.IStreamStore streams, Abblix.SharedSignals.Transmitter.IEventOutbox outbox, Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner signer, string issuer, Abblix.SharedSignals.Transmitter.IEventSharingPolicy? sharingPolicy=null, Abblix.SecurityEvents.Events.IEventPayloadPolicy? payloadPolicy=null, System.TimeProvider? clock=null);

Parameters

logger Microsoft.Extensions.Logging.ILogger<EventDispatcher>

Records the streams a fan-out could not reach.

streams IStreamStore

The transmitter's streams.

outbox IEventOutbox

Where minted SETs wait for delivery.

signer Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner

Signs each minted SET.

issuer System.String

The transmitter's issuer identifier - the "iss" of every SET, identical to the issuer the configuration metadata asserts (SSF 1.0 Section 7.1).

sharingPolicy IEventSharingPolicy

The host's Section 9.2 verdict; null shares every otherwise-matching event, which is the honest default only for a transmitter whose events carry nothing the receiver may not see.

payloadPolicy Abblix.SecurityEvents.Events.IEventPayloadPolicy

What this deployment refuses to emit, over and above what the event vocabulary permits - how a deployment claims a profile such as the CAEP Interoperability Profile. Null emits whatever the host builds, which is what a transmitter claiming no profile does.

clock System.TimeProvider

Supplies "iat"; null takes the system clock.

Methods

EventDispatcher.DispatchAsync(SecurityEventDescriptor, CancellationToken) Method

Dispatches one event to every stream it matches.

C#
public System.Threading.Tasks.Task<int> DispatchAsync(Abblix.SharedSignals.Transmitter.SecurityEventDescriptor descriptor, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

descriptor SecurityEventDescriptor

The event as the application states it.

cancellationToken System.Threading.CancellationToken

Cancels store reads, policy calls and signing.

Returns

System.Threading.Tasks.Task<System.Int32>
How many streams the event was enqueued for - zero is a legitimate answer for an event nobody subscribed to.

EventDispatcher.DispatchToStreamAsync(StreamState, SecurityEventDescriptor, bool, CancellationToken) Method

Dispatches one event to one stream, skipping the matching checks: the door for the framework's own signals, which a transmitter may send "even if the event is not present in the events_supported, events_requested and / or events_delivered fields" (SSF 1.0 Sections 8.1.4, 8.1.5) - and which must go out even to a stream being paused or disabled, since the stream-updated event precedes the stop.

C#
public System.Threading.Tasks.Task DispatchToStreamAsync(Abblix.SharedSignals.Transmitter.StreamState stream, Abblix.SharedSignals.Transmitter.SecurityEventDescriptor descriptor, bool asStatusAnnouncement=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

stream StreamState

The stream the event targets.

descriptor SecurityEventDescriptor

The event; for verification and stream-updated its subject is the stream's own opaque identifier (SSF 1.0 Sections 8.1.4.1, 8.1.5).

asStatusAnnouncement System.Boolean

True for the stream-updated event escorting a transmitter-initiated status change, so delivery carries it even over the stream it stops (SSF 1.0 Section 8.1.5).

cancellationToken System.Threading.CancellationToken

Cancels signing and the enqueue.

Returns

System.Threading.Tasks.Task