Package buildbot :: Package process :: Module cache :: Class CacheManager
[frames] | no frames]

Class CacheManager

source code

  config.ReconfigurableServiceMixin --+
                                      |
twisted.application.service.Service --+
                                      |
                                     CacheManager

A manager for a collection of caches, each for different types of objects and with potentially-overlapping key spaces.

There is generally only one instance of this class, available at master.caches.

Instance Methods
 
__init__(self) source code
 
get_cache(self, cache_name, miss_fn)
Get an AsyncLRUCache object with the given name.
source code
 
reconfigService(self, new_config) source code
 
get_metrics(self) source code

Inherited from config.ReconfigurableServiceMixin: __providedBy__, __provides__

Inherited from twisted.application.service.Service: __getstate__, disownServiceParent, privilegedStartService, setName, setServiceParent, startService, stopService

Class Variables
  DEFAULT_CACHE_SIZE = 1

Inherited from config.ReconfigurableServiceMixin: __implemented__, reconfig_priority

Inherited from twisted.application.service.Service: name, parent, running

Method Details

get_cache(self, cache_name, miss_fn)

source code 

Get an AsyncLRUCache object with the given name. If such an object does not exist, it will be created. Since the cache is permanent, this method can be called only once, e.g., in startService, and it value stored indefinitely.

Parameters:
  • cache_name - name of the cache (usually the name of the type of object it stores)
  • miss_fn - miss function for the cache; see AsyncLRUCache constructor.
Returns:
AsyncLRUCache instance

reconfigService(self, new_config)

source code 
Overrides: config.ReconfigurableServiceMixin.reconfigService