public static IServiceCollection AddUpdatesPollerService( this IServiceCollection services, PollerConfig config) { return(services .AddSingleton(config) .AddHostedService <UpdatesPollerService>()); }
public UpdatesPollerService( PollerConfig config, IUpdatesPublisher updatesPublisher, IUpdatesProvider updatesProvider, IUserLatestUpdateTimesRepository userLatestUpdateTimesRepository, ISentUpdatesRepository sentUpdatesRepository, VideoExtractor videoExtractor, ILogger <UpdatesPollerService> logger) { _config = config; _updatesPublisher = updatesPublisher; _updatesProvider = updatesProvider; _userLatestUpdateTimesRepository = userLatestUpdateTimesRepository; _sentUpdatesRepository = sentUpdatesRepository; _videoExtractor = videoExtractor; _logger = logger; }
public static IServiceCollection AddUpdatesProducer <TProvider>( this IServiceCollection services, MongoDbConfig mongoDbConfig, RabbitMqConfig rabbitMqConfig, UpdatesProviderBaseConfig updatesProviderBaseConfig, PollerConfig pollerConfig, VideoExtractorConfig videoExtractorConfig) where TProvider : class, IUpdatesProvider { services = mongoDbConfig != null ? services.AddUpdatesProducerMongoRepositories(mongoDbConfig) : services.AddUpdatesProducerMockRepositories(); return(services .AddRabbitMqUpdatesPublisher(rabbitMqConfig) .AddVideoExtractor(videoExtractorConfig) .AddUpdatesProvider <TProvider>(updatesProviderBaseConfig) .AddUpdatesPollerService(pollerConfig)); }