__init__(self,
cache,
address,
item_freshness_period,
item_expiration_period,
item_purge_period,
object_handler,
error_handler,
timeout_handler,
timeout_period,
backup_state=None)
(Constructor)
| source code
|
Initialize an CacheFetcher object.
- Parameters:
cache (Cache) - cache object which created this fetcher.
address (any hashable) - requested item address.
item_freshness_period (timedelta) - freshness period for the requested item.
item_expiration_period (timedelta) - expiration period for the requested item.
item_purge_period (timedelta) - purge period for the requested item.
object_handler (callable(address, value, state)) - function to be called after the item is fetched.
error_handler (callable(address, error_data)) - function to be called on error.
timeout_handler (callable(address)) - function to be called on timeout
timeout_period (timedelta) - timeout interval.
backup_state (bool ) - when not None and the fetch fails than an
object from cache of at least this state will be passed to the
object_handler . If such object is not available, then
error_handler is called.
|