HandlerRegistry.cs
640 bytes
| 1 | namespace SplitApp.Shared.Messaging.Internal; |
|---|---|
| 2 | |
| 3 | /// <summary> |
| 4 | /// DI-singleton list of all event/request handlers registered for this process. |
| 5 | /// Populated at startup via <see cref="ServiceCollectionExtensions.AddIntegrationEventHandler"/> |
| 6 | /// and read by <see cref="RabbitMqConsumerHostedService"/> to build consumer subscriptions. |
| 7 | /// </summary> |
| 8 | public class HandlerRegistry |
| 9 | { |
| 10 | private readonly List<MessageHandlerRegistration> _registrations = new(); |
| 11 | |
| 12 | public void Register(MessageHandlerRegistration registration) => _registrations.Add(registration); |
| 13 | |
| 14 | public IReadOnlyList<MessageHandlerRegistration> All => _registrations; |
| 15 | } |
| 16 | |