graphenecommon.objectcache module

class graphenecommon.objectcache.ObjectCacheInMemory(initial_data={}, default_expiration=60, no_overwrite=False, max_length=1000)

Bases: expiringdict.ExpiringDict, graphenecommon.objectcache.ObjectCacheInterface

This class implements an object/dict cache that comes with an expiration. Expired items are removed from the cache. The cache has a max_length.

get_expiration()

Return the default expiration

set_expiration(expiration)

Set new default expiration time in seconds (default: 10s)

class graphenecommon.objectcache.ObjectCacheInterface

Bases: object

get(key, default_value=None)
get_expiration()
set_expiration(value)