__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)
Initialize an `CacheFetcher` object.
:Parameters:
- `cache`: cache object which created this fetcher.
- `address`: requested item address.
- `item_freshness_period`: freshness period for the requested item.
- `item_expiration_period`: expiration period for the requested item.
- `item_purge_period`: purge period for the requested item.
- `object_handler`: function to be called after the item is fetched.
- `error_handler`: function to be called on error.
- `timeout_handler`: function to be called on timeout
- `timeout_period`: timeout interval.
- `backup_state`: 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.
:Types:
- `cache`: `Cache`
- `address`: any hashable
- `item_freshness_period`: `timedelta`
- `item_expiration_period`: `timedelta`
- `item_purge_period`: `timedelta`
- `object_handler`: callable(address, value, state)
- `error_handler`: callable(address, error_data)
- `timeout_handler`: callable(address)
- `timeout_period`: `timedelta`
- `backup_state`: `bool`
-
|