public async Task TriggerAction(Actions actions) { _internalLog($"Current latch ({_currentLatch.Name}) with action: '{actions.Name}'"); var nextLatch = _currentLatch.NextLatchFromAction(actions); _internalLog($"Next latch ({nextLatch.Name}) from action: '{actions.Name}'"); if (ShouldDoNothingForCurrentLatch(nextLatch)) { //DO NOTHING return; } await _currentLatch.Exit(); _currentLatch = nextLatch; //swap latches _internalLog($"Current latch has been updated and is now {_currentLatch.Name}"); await _currentLatch.Enter(); }