private void SyncModeSelectorOnChanging(object?sender, SyncModeChangedEventArgs e) { // at this stage beam executors are already cancelled and they no longer save to beam DB // standard processor is for sure not started yet - it is waiting for us to replace the target if (e.IsBeamSyncFinished()) { Interlocked.Exchange(ref _targetDbForSaves, _stateDb); } }
private void SyncModeSelectorOnChanged(object?sender, SyncModeChangedEventArgs e) { if (e.IsBeamSyncFinished()) { if (_logger.IsInfo) { _logger.Info("Setting block action to standard processing."); } _blockAction = EnqueueForStandardProcessing; UnregisterListeners(); } }
private void SyncModeSelectorOnChanged(object?sender, SyncModeChangedEventArgs e) { if (e.IsBeamSyncFinished()) { // the beam processor either already switched or is about to switch to the full sync mode // we should be already switched to the new database lock (_finishLock) { if (CurrentState != SyncFeedState.Finished) { // we do not want to finish this feed - instead we will keep using it in Beam Synced RPC requests // Finish(); UnregisterHandlers(); } } } }
private void SyncModeSelectorOnPreparing(object?sender, SyncModeChangedEventArgs e) { if (e.IsBeamSyncFinished()) { lock (_transitionLock) { if (_isAfterBeam) { // we do it only once - later we stay forever in full sync mode return; } _isAfterBeam = true; if (_logger.IsInfo) { _logger.Info("Setting block action to shelving."); } _blockAction = Shelve; } CancelAllBeamSyncTasks(); Task.WhenAll(_beamProcessTasks).Wait(); // sync mode selector is waiting for beam syncing blocks to stop } }