How to use the zict.lru.LRU function in zict

To help you get started, we’ve selected a few zict 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 dask / zict / zict / buffer.py View on Github external
def __init__(self, fast, slow, n, weight=lambda k, v: 1,
                 fast_to_slow_callbacks=None, slow_to_fast_callbacks=None,
                 keep_slow=True):
        self.fast = LRU(n, fast, weight=weight, on_evict=[self.fast_to_slow])
        self.slow = slow
        self.n = n
        self.weight = weight
        self.keep_slow = keep_slow
        if callable(fast_to_slow_callbacks):
            fast_to_slow_callbacks = [fast_to_slow_callbacks]
        if callable(slow_to_fast_callbacks):
            slow_to_fast_callbacks = [slow_to_fast_callbacks]
        self.fast_to_slow_callbacks = fast_to_slow_callbacks or []
        self.slow_to_fast_callbacks = slow_to_fast_callbacks or []

zict

Mutable mapping tools

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

64 / 100
Full package analysis

Similar packages