Home | Trees | Indices | Help |
|
---|
|
object --+ | LRUCache
Thread-safe, bounded, least-recently-used DNS answer cache.
This cache is better than the simple cache (above) if you're running a web crawler or other process that does a lot of resolutions. The LRUCache has a maximum number of nodes, and when it is full, the least-recently used node is removed to make space for a new one.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
*max_size*, an ``int``, is the maximum number of nodes to cache; it must be greater than 0.
|
Get the answer associated with *key*. Returns None if no answer is cached for the key. *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the query name, rdtype, and rdclass respectively. Returns a ``dns.resolver.Answer`` or ``None``. |
Associate key and value in the cache. *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the query name, rdtype, and rdclass respectively. *value*, a ``dns.resolver.Answer``, the answer. |
Flush the cache. If *key* is not ``None``, only that item is flushed. Otherwise the entire cache is flushed. *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the query name, rdtype, and rdclass respectively. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Dec 8 10:59:55 2018 | http://epydoc.sourceforge.net |