How to use the cachetools.Cache.__init__ function in cachetools

To help you get started, we’ve selected a few cachetools 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 scrapinghub / frontera / frontera / contrib / backends / hbase / domaincache.py View on Github external
def __init__(self, maxsize, missing=None, getsizeof=None):
        Cache.__init__(self, maxsize, missing=missing, getsizeof=getsizeof)
        self.__order = collections.OrderedDict()
github tkem / cachetools / cachetools.py View on Github external
def __init__(self, maxsize, getsizeof=None):
        if getsizeof is not None:
            Cache.__init__(self, maxsize, lambda e: getsizeof(e[0]))
        else:
            Cache.__init__(self, maxsize)
github tkem / cachetools / cachetools.py View on Github external
def __init__(self, maxsize, getsizeof=None):
        if getsizeof is not None:
            Cache.__init__(self, maxsize, lambda e: getsizeof(e[0]))
        else:
            Cache.__init__(self, maxsize)
        root = _Link()
        root.prev = root.next = root
        self.__root = root
github tkem / cachetools / cachetools.py View on Github external
def __init__(self, maxsize, getsizeof=None):
        if getsizeof is not None:
            Cache.__init__(self, maxsize, lambda e: getsizeof(e[0]))
        else:
            Cache.__init__(self, maxsize)
        root = _Link()
        root.prev = root.next = root
        self.__root = root
github gramener / gramex / gramex / services / ttlcache.py View on Github external
def __init__(self, maxsize, ttl=MAXTTL, timer=time.time, getsizeof=None):
        Cache.__init__(self, maxsize, getsizeof)
        self.__root = root = _Link()
        root.prev = root.next = root
        self.__links = collections.OrderedDict()
        self.__timer = _Timer(timer)
        self.__ttl = ttl
        # CHANGE: .set() is the same as setitem
        self.set = self.__setitem__
github tkem / cachetools / cachetools.py View on Github external
def __init__(self, maxsize, getsizeof=None):
        if getsizeof is not None:
            Cache.__init__(self, maxsize, lambda e: getsizeof(e[0]))
        else:
            Cache.__init__(self, maxsize)