Esempio n. 1
0
        public Module(Configurations configurations, EventsToSubscribe eventsToSubscribe, IEventBus eventBus)
        {
            this._configurations = configurations ?? throw new ArgumentNullException(nameof(configurations));
            this._eventBus       = eventBus ?? throw new ArgumentNullException(nameof(eventBus));

            this.SubscribeEvents(eventsToSubscribe);
        }
Esempio n. 2
0
        protected override async Task SubscribeEvents(EventsToSubscribe eventsToSubscribe)
        {
            if (eventsToSubscribe is null || !eventsToSubscribe.HasEvents)
            {
                return;
            }

            foreach (var @event in eventsToSubscribe.Events)
            {
                await this._eventBus.Subscribe(@event, this.HandleEvent);
            }
        }
Esempio n. 3
0
 public NotificationModule(Configurations configurations, EventsToSubscribe eventsToSubscribe, IEventBus eventBus)
     : base(configurations, eventsToSubscribe, eventBus)
 {
     this._container = this.BuildContainer(configurations, eventBus);
 }
Esempio n. 4
0
 protected abstract Task SubscribeEvents(EventsToSubscribe eventsToSubscribe);