Exemplo n.º 1
0
        private void ProcessDisconnect(bool retry)
        {
            lock (_lock)
            {
                if (!_streamingConnected)
                {
                    _log.Debug("Streaming already disconnected.");
                    return;
                }

                _streamingConnected = false;
                _sseHandler.StopWorkers();
                _synchronizer.SyncAll(_shutdownCancellationTokenSource);
                _synchronizer.StartPeriodicFetching();
                _telemetryRuntimeProducer.RecordStreamingEvent(new StreamingEvent(EventTypeEnum.SyncMode, (int)SyncModeEnum.Polling));

                if (retry)
                {
                    _pushManager.StartSse();
                }
            }
        }
Exemplo n.º 2
0
 private void OnOccupancyEvent(object sender, OccupancyEventArgs e)
 {
     if (e.PublisherAvailable)
     {
         _synchronizer.StopPeriodicFetching();
         _synchronizer.SyncAll();
         _sseHandler.StartWorkers();
     }
     else
     {
         _sseHandler.StopWorkers();
         _synchronizer.StartPeriodicFetching();
     }
 }