dictrack.data_caches package#

Submodules#

dictrack.data_caches.base module#

class dictrack.data_caches.base.BaseDataCache(scheduler_class=<class 'apscheduler.schedulers.background.BackgroundScheduler'>, check_interval=1800, stale_threshold=21600)#

Bases: object

abstract cache(group_id, tracker, force=False, **kwargs)#

Implement for storing a single data item under the specified group_id in the data cache.

abstract cache_all(group_id, trackers, force=False, **kwargs)#

Implement for storing multiple data items under the specified group_id in the data cache.

abstract fetch(group_id, name=None, **kwargs)#

Implement for retrieving data from the cache under the specified group_id. If name is None, retrieve all data under group_id; if name is provided, retrieve only the specified data.

abstract flush()#

Implement for clearing all data from the data cache.

abstract is_cached(group_id, name=None, **kwargs)#

Implement for checking if data exists in the data cache. If name is None, checks all data under group_id; if name is provided, checks only the specified data.

abstract remove(group_id, name=None, **kwargs)#

Implement for removing data from the data cache. If name is None, removes all data under group_id; if name is provided, removes only the specified data.

start_scheduler()#
abstract track(group_id, data, *args, **kwargs)#

Implement for tracking and updating the cache with the specified data under the given group_id. Ensure proper handling of race conditions in a distributed architecture, for example, by using a distributed lock.

dictrack.data_caches.memory module#

dictrack.data_caches.redis module#

Module contents#