Constructor
Support for the 'in' operator
The cache class. We need to enable GC scanning of the values stored in the cache because they contain references.
Remove all object from the cache.
Looks up the record value corresponding to key and invokes got with either that value, if found, or empty data if not found. Should return without calling got if unable to look up the value.
Gets the record value corresponding to key.
This method is called before storing new entry into the cache. It can be used to do any adjustments necessary for specific cached type. Does nothing by default which is most common case for exsting caches.
Gets the record value corresponding to key.
Info interface for the cache instance is exposed to the public.
Base class for a cache. To use it you need to inherit it and override getData method. It operates only on contiguous struct buffers and does a copy of such buffer before returning cache element.
Recommended code pattern is to have a shared Cache but a fiber-local CachingStructLoader so that last accessed element won't become invalidated between context switches