How to use the aiomisc.circuit_breaker.CounterKey function in aiomisc

To help you get started, we’ve selected a few aiomisc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aiokitchen / aiomisc / aiomisc / circuit_breaker.py View on Github external
def _on_passing(self, counter):
        try:
            yield
            counter[CounterKey.OK] += 1
        except self._exceptions:
            counter[CounterKey.FAIL] += 1
            raise
        finally:
            counter[CounterKey.TOTAL] += 1
github aiokitchen / aiomisc / aiomisc / circuit_breaker.py View on Github external
def _on_passing(self, counter):
        try:
            yield
            counter[CounterKey.OK] += 1
        except self._exceptions:
            counter[CounterKey.FAIL] += 1
            raise
        finally:
            counter[CounterKey.TOTAL] += 1
github aiokitchen / aiomisc / aiomisc / circuit_breaker.py View on Github external
def _on_passing(self, counter):
        try:
            yield
            counter[CounterKey.OK] += 1
        except self._exceptions:
            counter[CounterKey.FAIL] += 1
            raise
        finally:
            counter[CounterKey.TOTAL] += 1