public void StartPeriodicDataRecording_ShouldStartServices() { // Act. _synchronizer.StartPeriodicDataRecording(); // Assert. _impressionsLog.Verify(mock => mock.Start(), Times.Once); _eventsLog.Verify(mock => mock.Start(), Times.Once); _metricsLog.Verify(mock => mock.Start(), Times.Once); }
public void Start() { _tasksManager.Start(() => { try { while (!_synchronizer.SyncAll(_shutdownCancellationTokenSource, asynchronous: false)) { _wrapperAdapter.TaskDelay(500).Wait(); } _statusManager.SetReady(); _telemetrySyncTask.RecordConfigInit(); _synchronizer.StartPeriodicDataRecording(); if (_streamingEnabled) { _log.Debug("Starting streaming mode..."); var connected = _pushManager.StartSse().Result; if (connected) { return; } } _log.Debug("Starting polling mode ..."); _synchronizer.StartPeriodicFetching(); _telemetryRuntimeProducer.RecordStreamingEvent(new StreamingEvent(EventTypeEnum.SyncMode, (int)SyncModeEnum.Polling)); } catch (Exception ex) { _log.Debug("Exception initialization SDK.", ex); } }, _shutdownCancellationTokenSource, "SDK Initialization"); }
private void StartPoll() { _log.Debug("Starting push mode ..."); _synchronizer.StartPeriodicFetching(); _synchronizer.StartPeriodicDataRecording(); }