protected override void Handle(SpeedPauseReachedCommand command) { if (command.RequestId == _currentWaitingId) { _numberOfClients++; if (_numberOfClients == _maxNumberOfClients) { SpeedPauseHelper.StateReached(); _currentWaitingId = -1; } } }
protected override void Handle(SpeedPauseReachedCommand command) { if (command.RequestId == _currentWaitingId) { _numberOfClients++; if (_numberOfClients == _maxNumberOfClients) { SpeedPauseHelper.StateReached(); _currentWaitingId = -1; // Allow the response handler to process new requests // We need to wait until now because responses of conflicting requests // could arrive during the waiting phase, but need to be discarded. SpeedPauseResponseHandler.ResetWaitingId(); } } }