How to use the decorator.memoize function in decorator

To help you get started, we’ve selected a few decorator 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 Chaosthebot / Chaos / memoize / tests.py View on Github external
        @memoize("1m", backend=self.backend_factory)
        def fn(a, b, c):
            return a + b + c
github Chaosthebot / Chaos / memoize / tests.py View on Github external
        @memoize("30s", backend=self.backend_factory, get_now=get_now)
        def fn(a, b, c):
            c = state["counter"]
            state["counter"] += 1
            return c
github Chaosthebot / Chaos / memoize / tests.py View on Github external
        @memoize("1m", whitelist=("b", "c"))
        def fn(a, b, c):
            return a + b + c
github Chaosthebot / Chaos / memoize / tests.py View on Github external
        @memoize("1m", blacklist=("a", "c"))
        def fn(a, b, c):
            return a + b + c
github Chaosthebot / Chaos / memoize / tests.py View on Github external
        @memoize("1m")
        def fn(a, b, c):
            c = state["counter"]
            state["counter"] += 1
            return c