endas.arraycache.LRUArrayCache

class endas.arraycache.LRUArrayCache(maxsizeMB=1024, tempdir=None)

Bases: endas.arraycache.ArrayCache

Data cache that swaps recently used data objects to disk.

The cache will keep items in memory as long as their combined size os below maxsizeMB. When the capacity is reached, least recently accessed items are swapped to storage to make space.

This implementation uses file-based storage in the given tempdir or system default temp directory if tempdir is None. Subclasses can override retire(), restore() and drop() to implement other storage mechanisms.

# Todo: Implement thread safety at some point.