| Home | Trees | Index | Help |
|
|---|
| Package pyxmpp :: Module cache :: Class CacheItem |
|
object --+
|
CacheItem
An item in a cache.
:Ivariables:
- `value`: item value (cached object).
- `address`: item address.
- `state`: current state.
- `state_value`: numerical value of the current state (lower number means
fresher item).
- `timestamp`: time when the object was created.
- `freshness_time`: time when the object stops being fresh.
- `expire_time`: time when the object expires.
- `purge_time`: time when the object should be purged. When 0 then
item will never be automaticaly purged.
- `_lock`: lock for thread safety.
:Types:
- `value`: `instance`
- `address`: any hashable
- `state`: `str`
- `state_value`: `int`
- `timestamp`: `datetime`
- `freshness_time`: `datetime`
- `expire_time`: `datetime`
- `purge_time`: `datetime`
- `_lock`: `threading.RLock`
| Method Summary | |
|---|---|
Initialize an CacheItem object. | |
__cmp__(self,
other)
| |
Update current status of the item and compute time of the next state change. | |
| 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) | |
| Class Variable Summary | |
|---|---|
list |
__slots__ = ['value', 'address', 'state', 'timestamp', '...
|
member_descriptor |
address = <member 'address' of 'CacheItem' objects>
|
member_descriptor |
expire_time = <member 'expire_time' of 'CacheItem' objec...
|
member_descriptor |
freshness_time = <member 'freshness_time' of 'CacheItem'...
|
member_descriptor |
purge_time = <member 'purge_time' of 'CacheItem' objects...
|
member_descriptor |
state = <member 'state' of 'CacheItem' objects>
|
member_descriptor |
state_value = <member 'state_value' of 'CacheItem' objec...
|
member_descriptor |
timestamp = <member 'timestamp' of 'CacheItem' objects>
|
member_descriptor |
value = <member 'value' of 'CacheItem' objects>
|
| Method Details |
|---|
__init__(self,
address,
value,
freshness_period,
expiration_period,
purge_period,
state='new')
|
update_state(self)Update current status of the item and compute time of the next state change. :return: the new state. :returntype: `datetime` |
| Class Variable Details |
|---|
__slots__
|
address
|
expire_time
|
freshness_time
|
purge_time
|
state
|
state_value
|
timestamp
|
value
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Wed May 31 22:36:58 2006 | http://epydoc.sf.net |