Beispiel #1
0
        public SyncManager(bool streamingEnabled,
                           ISynchronizer synchronizer,
                           IPushManager pushManager,
                           ISSEHandler sseHandler,
                           INotificationManagerKeeper notificationManagerKeeper,
                           ITelemetryRuntimeProducer telemetryRuntimeProducer,
                           IStatusManager statusManager,
                           ITasksManager tasksManager,
                           IWrapperAdapter wrapperAdapter,
                           ITelemetrySyncTask telemetrySyncTask,
                           ISplitLogger log = null)
        {
            _streamingEnabled = streamingEnabled;
            _synchronizer     = synchronizer;
            _pushManager      = pushManager;
            _sseHandler       = sseHandler;
            _log = log ?? WrapperAdapter.GetLogger(typeof(Synchronizer));
            _telemetryRuntimeProducer = telemetryRuntimeProducer;
            _statusManager            = statusManager;
            _tasksManager             = tasksManager;
            _wrapperAdapter           = wrapperAdapter;
            _telemetrySyncTask        = telemetrySyncTask;

            _sseHandler.ActionEvent += OnProcessFeedbackSSE;
            notificationManagerKeeper.ActionEvent += OnProcessFeedbackSSE;

            _shutdownCancellationTokenSource = new CancellationTokenSource();
        }
Beispiel #2
0
        public NotificationManagerKeeperTests()
        {
            _log = new Mock <ISplitLogger>();

            _notificationManagerKeeper = new NotificationManagerKeeper(_log.Object);
            _notificationManagerKeeper.OccupancyEvent    += OnOccupancyEvent;
            _notificationManagerKeeper.PushShutdownEvent += OnPushShutdownEvent;
        }
Beispiel #3
0
        public NotificationManagerKeeperTests()
        {
            _log = new Mock <ISplitLogger>();
            _telemetryRuntimeProducer = new Mock <ITelemetryRuntimeProducer>();

            _notificationManagerKeeper              = new NotificationManagerKeeper(_telemetryRuntimeProducer.Object, _log.Object);
            _notificationManagerKeeper.ActionEvent += OnActionEvent;
        }
Beispiel #4
0
        public SyncManager(bool streamingEnabled,
                           ISynchronizer synchronizer,
                           IPushManager pushManager,
                           ISSEHandler sseHandler,
                           INotificationManagerKeeper notificationManagerKeeper,
                           ISplitLogger log = null)
        {
            _streamingEnabled = streamingEnabled;
            _synchronizer     = synchronizer;
            _pushManager      = pushManager;
            _sseHandler       = sseHandler;
            _log = log ?? WrapperAdapter.GetLogger(typeof(Synchronizer));

            _sseHandler.ConnectedEvent  += OnProcessFeedbackSSE;
            _sseHandler.DisconnectEvent += OnProcessFeedbackSSE;
            notificationManagerKeeper.OccupancyEvent    += OnOccupancyEvent;
            notificationManagerKeeper.PushShutdownEvent += OnPushShutdownEvent;
        }
Beispiel #5
0
        public SSEHandler(string streaminServiceUrl,
                          ISplitsWorker splitsWorker,
                          ISegmentsWorker segmentsWorker,
                          INotificationProcessor notificationPorcessor,
                          INotificationManagerKeeper notificationManagerKeeper,
                          ISplitLogger log = null,
                          IEventSourceClient eventSourceClient = null)
        {
            _streaminServiceUrl        = streaminServiceUrl;
            _splitsWorker              = splitsWorker;
            _segmentsWorker            = segmentsWorker;
            _notificationPorcessor     = notificationPorcessor;
            _notificationManagerKeeper = notificationManagerKeeper;
            _log = log ?? WrapperAdapter.GetLogger(typeof(SSEHandler));
            _eventSourceClient = eventSourceClient;

            _eventSourceClient.EventReceived += EventReceived;
            _eventSourceClient.ActionEvent   += OnAction;
        }