-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
23 lines (19 loc) · 803 Bytes
/
Program.cs
File metadata and controls
23 lines (19 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace EventBusStuff;
public static class Program {
private static EventBus? _eventBus;
private static ServiceA? _serviceA;
private static ServiceB? _serviceB;
private static ServiceC? _serviceC;
public static async Task Main() {
_eventBus = new();
_serviceA = new(_eventBus);
_serviceB = new(_eventBus);
_serviceC = new(_eventBus);
var resultsA = await _serviceA.FireEvent2();
var resultsB = await _serviceB.FireEvent3();
var resultsC = await _serviceC.FireEvent1();
if (resultsA.Length > 0) Console.WriteLine($"ResultsA : {string.Join(':', resultsA)}");
if (resultsB.Length > 0) Console.WriteLine($"ResultsB : {string.Join(':', resultsB)}");
if (resultsC.Length > 0) Console.WriteLine($"ResultsC : {string.Join(':', resultsC)}");
}
}