idmtools.services.ipersistance_service module#
IPersistenceService allows caching of items locally into a diskcache db that does not expire upon deletion.
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
- class idmtools.services.ipersistance_service.IPersistenceService[source]#
Bases:
object
IPersistenceService provides a persistent cache. This is useful for network heavy operations.
- cache_directory = None#
- cache_name = None#
- classmethod retrieve(uid)[source]#
Retrieve item with id <uid> from cache.
- Parameters:
uid – Id to fetch
- Returns:
Item loaded from cache
- classmethod save(obj)[source]#
Save an item to our cache.
- Parameters:
obj – Object to save.
- Returns:
Object uid