Skip to content

CommandNotifier

Alex edited this page Jan 29, 2021 · 1 revision

ResilientCommandNotifier is a way to keep tabs on which events has been run as part of the current execution.
The notifier is set through the singleton factory EventNotifierFactory. Only a single notifier is currently supported at a time.

Example

public class ConsoleEventNotifier : ResilientCommandEventNotifier
{
    public override void MarkEvent(ResillientCommandEventType eventType, CommandKey commandKey)
    {
        Console.WriteLine($"{commandKey}: {eventType}");
    }
}

...
// In startup or whichever entrypoint you are using.
EventNotifierFactory.GetInstance().SetEventNotifier(new ConsoleEventNotifier());
...

Note: The default implementation doesnt do anything. You will have to create a new implementation and set the notifier

Clone this wiki locally