Home | Trees | Index | Help |
|
---|
Package dns :: Module resolver :: Class Cache |
|
object
--+
|
Cache
Method Summary | |
---|---|
Initialize a DNS cache. | |
a new object with type S, a subtype of T |
|
Flush the cache. | |
dns.resolver.Answer object or None |
Get the answer associated with key. |
Clean the cache if it's time to do so. | |
Associate key and value in the cache. |
Instance Variable Summary | |
---|---|
float | cleaning_interval
- The number of seconds between cleanings. |
dict | data
- A dictionary of cached data |
float | next_cleaning
- The time the cache should next be cleaned (in seconds since the
epoch.) |
Method Details |
---|
__init__(self,
cleaning_interval=300.0)
Initialize a DNS cache.
|
__new__(S, ...)
|
flush(self, key=None)Flush the cache. If key is specified, only that item is flushed. Otherwise the entire cache is flushed.
|
get(self, key)Get the answer associated with key. Returns None if no answer is cached for the key.
|
maybe_clean(self)Clean the cache if it's time to do so. |
put(self, key, value)Associate key and value in the cache.
|
Instance Variable Details |
---|
cleaning_intervalThe number of seconds between cleanings. The default is 300 (5 minutes).
|
dataA dictionary of cached data
|
next_cleaningThe time the cache should next be cleaned (in seconds since the epoch.)
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 1.1 on Fri Nov 7 14:49:30 2003 | http://epydoc.sf.net |