| Home | Trees | Index | Help |
|
|---|
| Package dns :: Module resolver :: Class Cache |
|
object --+
|
Cache
| Method Summary | |
|---|---|
Initialize a DNS cache. | |
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. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| 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.
|
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 2.1 on Thu Apr 1 12:10:12 2004 | http://epydoc.sf.net |