Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EventSinks.cs
1using System.Threading.Tasks;
2
4{
8 public class EventSinks : EventSink
9 {
10 private readonly IEventSink[] sinks;
11 private readonly int nrSinks;
12
18 public EventSinks(string ObjectID, params IEventSink[] Sinks)
19 : base(ObjectID)
20 {
21 this.sinks = Sinks;
22 this.nrSinks = this.sinks?.Length ?? 0;
23 }
24
29 public override Task Queue(Event Event)
30 {
31 Task[] Tasks = new Task[this.nrSinks];
32 int i;
33
34 for (i = 0; i < this.nrSinks; i++)
35 Tasks[i] = this.sinks[i].Queue(Event);
36
37 return Task.WhenAll(Tasks);
38 }
39 }
40}
Class representing an event.
Definition: Event.cs:11
Base class for event sinks.
Definition: EventSink.cs:9
Sends logged events to a collection of event sinks.
Definition: EventSinks.cs:9
override Task Queue(Event Event)
Queues an event to be output.
Definition: EventSinks.cs:29
EventSinks(string ObjectID, params IEventSink[] Sinks)
Sends logged events to a collection of event sinks.
Definition: EventSinks.cs:18
virtual string ObjectID
Object ID, used when logging events.
Definition: LogObject.cs:26
Interface for all event sinks.
Definition: IEventSink.cs:9