How to use the darts.lib.utils.lru.LRUDict function in darts

To help you get started, we’ve selected a few darts 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 andresriancho / w3af / w3af / core / controllers / core_helpers / not_found / decorators.py View on Github external
def __init__(self, _function):
        self._function = _function

        # The performance impact of storing many items in the cached
        # (in memory) part of the CachedDiskDict is low. The keys for
        # this cache are hashes and the values are booleans
        #
        # Using the LRUDict instead of SynchronizedLRUDict because this decorator
        # is run wrapped around PreventMultipleThreads, and also because we're
        # consuming it in a way where thread-generated race condition errors can
        # be ignored (they do not generate a big impact)
        #
        # LRUDict is faster than SynchronizedLRUDict because there are no locks
        self._is_404_by_url_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)
        self._is_404_by_body_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)

        self._stats_from_cache = 0.0
        self._stats_total = 0.0

        self._response_cache_key_cache = ResponseCacheKeyCache()
github andresriancho / w3af / w3af / core / controllers / core_helpers / not_found / decorators.py View on Github external
def __init__(self, _function):
        self._function = _function

        # The performance impact of storing many items in the cached
        # (in memory) part of the CachedDiskDict is low. The keys for
        # this cache are hashes and the values are booleans
        #
        # Using the LRUDict instead of SynchronizedLRUDict because this decorator
        # is run wrapped around PreventMultipleThreads, and also because we're
        # consuming it in a way where thread-generated race condition errors can
        # be ignored (they do not generate a big impact)
        #
        # LRUDict is faster than SynchronizedLRUDict because there are no locks
        self._is_404_by_url_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)
        self._is_404_by_body_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)

        self._stats_from_cache = 0.0
        self._stats_total = 0.0

        self._response_cache_key_cache = ResponseCacheKeyCache()