Table of Contents

Class BridgeEvent

Namespace
Nyra.Abstractions
Assembly
Nyra.dll

Bridge event raises with per-handler isolation, a plain multicast invoke lets one throwing subscriber block every handler subscribed after it, and the wiring's routing is one of those handlers.

public static class BridgeEvent
Inheritance
BridgeEvent
Inherited Members

Remarks

Each subscriber runs in its own try, a crash is reported to the logger when one is provided and the rest still run. Crashes of the same kind are reported five times per thirty seconds, so a subscriber that fails on every event cannot flood the log. Bridge implementations raise their events through this helper instead of a plain invoke.

Methods

RaiseIsolated<TArgs>(EventHandler<TArgs>?, object, TArgs, ILogger?)

Raises handler one subscriber at a time, a throwing subscriber is reported to the logger when one is provided and the remaining subscribers still run.

public static void RaiseIsolated<TArgs>(EventHandler<TArgs>? handler, object sender, TArgs args, ILogger? logger) where TArgs : EventArgs

Parameters

handler EventHandler<TArgs>

The multicast delegate to invoke, null raises nothing.

sender object

The sender every subscriber receives.

args TArgs

The payload every subscriber receives.

logger ILogger

Where a throwing subscriber's exception is reported, null ignores it.

Type Parameters

TArgs

The type of the event payload.