Cache to store items retrieved with the modelit.concurrent.ThreadPoolExecutor on disk.
directory | String with the directory to which the CacheItems are saved. | |
maxage | Number of days to keep the cachefiles. |
Cache to store items retrieved with the modelit.concurrent.ThreadPoolExecutor on disk.
obj = DiskCache(directory)
directory | string | with the directory in which to store the cachefiles. |
obj | modelit.mapviewer.DiskCache | Documentation for modelit.mapviewer.DiskCache/DiskCache doc modelit.mapviewer.DiskCache |
Add an item to the Cache.
add(obj, key, data, maxage)
obj | modelit.mapviewer.DiskCache | |
key | any | <string> key to retrieve the CacheItem. |
data | any | <bytes> the data in a byte array. |
maxage | any | <number> not used here, specified in modelit.mapviewer.Cache. |
Get an item from the Cache by using its key.
data = getCacheItem(obj, key)
obj | modelit.mapviewer.DiskCache | |
key | string | key to retrieve the CacheItem. |
data | any | <bytes> the data in a byte array. |
Clear all the items in the Cache.
item = getCacheItem(obj, key)
obj | modelit.mapviewer.DiskCache |
Remove an item with the specified key from the Cache.
remove(obj, key)
obj | any | <modelit.mapviewer.DiskCache> |
key | any | <string> key of the CacheItem to remove. |
Remove all expired items from the Cache and limit the total items to maxItems.
purge(obj) Help for modelit.mapviewer.DiskCache/purge is inherited from superclass modelit.mapviewer.Cache