Skip to main content

NameDescription
ec_cache_createCreate a cache with max_elts
ec_cache_create2Create a cache with max_elts
ec_cache_deleteDelete an item determined by key from a cache
ec_cache_delrefDelete a reference from a cached item determined by elt in a cache
ec_cache_destroyPurge all entries from the cache and free all memory allocated to it
ec_cache_findFind a cache item determined by a key
ec_cache_get_statsGet cache statistics (deprecated)
ec_cache_get_stats2get cache statistics
ec_cache_get_stats_by_nameget cache statistics for a named cache
ec_cache_insertInsert a key/value pair into a cache
ec_cache_purgeExplicitly remove elements from the cache
ec_cache_resolveLook up an element from the cache
ec_cache_resolver_delrefRelease a resolver object reference
ec_cache_resolver_run_on_completionSchedule a function to run when the resolver completes
ec_cache_resolver_set_completeStores the resolved cache element in the resolver
ec_cache_resolver_wait_for_completionBlocks the caller until cache resolution completes
ec_cache_resolver_wake_on_completionAllows a thread to block, pending completion of the cache resolution

A common requirement for high performance modules is to cache information that is expensive to obtain. The generic cache implementation in Momentum operates by having an upper bound on the number of elements to be stored in a cache, pushing out the least recently used item when an insert is made and the cache is full. You may optionally set a time-to-live for the cache; elements that have been stored in the cache for longer than the time-to-live will, periodically, be expired from the cache.

The APIs documented here relate to the cache list console command.

Was this page helpful?