2 using System.Collections.Generic;
4 using System.Threading.Tasks;
29 this.configuration = configuration ??
throw new ArgumentNullException(nameof(configuration));
33 public async Task
HandleEvent(
EventType eventType, IEnumerable<string> parameters, CancellationToken cancellationToken)
36 throw new InvalidOperationException(
"EventConsumer used without watchdog set!");
38 await configuration.HandleEvent(eventType, parameters, cancellationToken).ConfigureAwait(
false);
39 await watchdog.
HandleEvent(eventType, parameters, cancellationToken).ConfigureAwait(
false);
48 #pragma warning disable IDE0016 // Use 'throw' expression 50 throw new ArgumentNullException(nameof(watchdog));
51 #pragma warning restore IDE0016 // Use 'throw' expression 52 if (this.watchdog != null)
53 throw new InvalidOperationException(
"watchdog already set!");
54 this.watchdog = watchdog;
EventConsumer(IConfiguration configuration)
Construct an IEventConsumer
EventType
Types of events. Mirror in tgs.dm
async Task HandleEvent(EventType eventType, IEnumerable< string > parameters, CancellationToken cancellationToken)
Handle a given eventType
void SetWatchdog(IWatchdog watchdog)
Set the watchdog for the EventConsumer
readonly IConfiguration configuration
The IConfiguration for the EventConsumer
IWatchdog watchdog
The IWatchdog for the EventConsumer
Consumes EventTypes and takes the appropriate actions
For managing the Configuration directory
Task HandleEvent(EventType eventType, IEnumerable< string > parameters, CancellationToken cancellationToken)
Handle a given eventType
Runs and monitors the twin server controllers