public UsersIntegrationService( IScopedServiceFactory <FileDbContext> dbContextScopeFactory, IHttpClientWrapper httpClientWrapper, IEventBusWrapper eventBus, ILoggerFactory loggerFactory) { this.dbContextScopeFactory = dbContextScopeFactory; this.httpClientWrapper = httpClientWrapper; this.eventBus = eventBus; this.logger = loggerFactory.CreateLogger <UsersIntegrationService>(); }
public FileLockExpiryNotificator(IEventBusWrapper eventBus, ILoggerFactory loggerFactory) { this.eventBus = eventBus; this.logger = loggerFactory.CreateLogger <FileLockExpiryNotificator>(); this.expiryDatesByFileId = new SimplePriorityQueue <FileLockExpiryInfo, DateTime>(); this.timer = new Timer { AutoReset = true, Interval = int.MaxValue, }; this.timer.Elapsed += ProcessLockExpiry; this.timer.Start(); }
public FileLockChangedNotificator( IEventBusWrapper eventBus, IClientGroupsManager clientGroupsManager, ILoggerFactory loggerFactory) { this.eventBus = eventBus; this.clientGroupsManager = clientGroupsManager; this.logger = loggerFactory.CreateLogger <FileLockChangedNotificator>(); eventBus.Subscribe <FileLockChangedEvent, FileLockChangedMessage>(message => { logger.LogTrace("Event: " + message.FileId); clientGroupsManager.SendToGroup(message.FileId, message); }); }
public static void Subscribe <TEvent, TMessage>(this IEventBusWrapper @this, Action <TMessage> messageHandler) where TEvent : IEvent <TMessage> { @this.Subscribe(new EventHandlerAdapter <TEvent, TMessage>(messageHandler)); }