The parent this cache is derived from.
The parent this cache is derived from.
Try to load a value from the cache with the given key.
Try to load a value from the cache with the given key.
This will try to fetch the value from the in-memory cache with no remote call on cache-misses.
unique key of the needed value.
an optional value if found, None otherwise.
Test if the cache has been started.
Test if the cache has been started.
Notifies all registered SyncCacheEventHandler
's that
cache
was reloaded.
Notifies all registered SyncCacheEventHandler
's that
cache
was reloaded.
- cache that was reloaded
Defines callback for cache miss.
Defines callback for cache miss.
- key for which we have a cache miss
- value for which we have a cache miss
Defines callback for cache reload.
Defines callback for cache reload.
- the cache that was reloaded
Loads the content of this cache from its parent, if the parent is started.
Loads the content of this cache from its parent, if the parent is started. Register itself for parent cache change notifications.
This method should be called only once, when the cache is ready to receive notifications. Subsequent calls to this method are of no effect.
this cache ready to receive notifications from its parent
Register a SyncCacheEventHandler
to be notified for cache events.
Register a SyncCacheEventHandler
to be notified for cache events.
- the handler to be notified for cache events
Stop the cache from loading.
Stop the cache from loading.
Starts the loading of the cache.
Starts the loading of the cache.
Adapts an AsyncCache to the SyncCache interface. Updates to the async parent cache become visible as the values become available and cache lookups to the sync cache trigger async on-cache-miss. But due to the sync nature of the adapter, these cache misses only become visible when the async call has returned, i.e. some time later. The behaviour will be that a cache miss will return None initially and Some some time later.
19/Apr/2016 17:55