public static void Initialize(IEventRegistry eventRegistry, IEventBus eventBus, AnalyticsOperationRequestRepository OperationRequestRepository, AnalyticsRegistry analyticsRegistry)//, IServiceProvider services) { _eventRegistry = eventRegistry; _eventBus = eventBus; _OperationRequestRepository = OperationRequestRepository; _analyticsRegistry = analyticsRegistry; }
/// <summary> /// Subscribe to new analytical modules. It's not the best place for this method. /// </summary> public static void ListenNewModules() { _eventRegistry.Register <AnalyticModuleRegistrationRequestEvent>(Exchanges.ModuleRegistration); _eventBus.SubscribeToTopic((AnalyticModuleRegistrationRequestEvent @event) => { using (IServiceScope scope = Services.CreateScope()) { _analyticsRegistry = scope.ServiceProvider.GetRequiredService <AnalyticsRegistry>(); _analyticsRegistry.Register(@event.Module); } }); }
public AnalyticsService(IEventBus eventBus, AnalyticsOperationRequestRepository operationRequestRepository, AnalyticsRegistry analyticsRegistry) { _eventBus = eventBus; _operationRequestRepository = operationRequestRepository; _analyticsRegistry = analyticsRegistry; }