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