Skip to main content

DiskCache

Implementation of AbstractCache using the DiskCache library.
This class provides a concrete implementation of the AbstractCache interface using the diskcache library for caching data on disk.
Attributes:
cache (diskcache.Cache): The DiskCache instance used for caching.
Methods:
init(self, seed): Initializes the DiskCache with the given seed.
get(self, key, default=None): Retrieves an item from the cache.
set(self, key, value): Sets an item in the cache.
close(self): Closes the cache.
enter(self): Context management entry.
exit(self, exc_type, exc_value, traceback): Context management exit.
Initialize the DiskCache instance.
Parameters:

Instance Methods

close

Close the cache.
Perform any necessary cleanup, such as closing file handles or releasing resources.

get

Retrieve an item from the cache.
Parameters: Returns:

set

Set an item in the cache.
Parameters: