This document describes the current stable version of Celery (3.1). For development docs, go here.
celery.datastructures¶
Custom types and data structures.
ConfigurationView¶
-
class
celery.datastructures.ConfigurationView(changes, defaults)[source]¶ A view over an applications configuration dicts.
Custom (but older) version of
collections.ChainMap.If the key does not exist in
changes, thedefaultsdicts are consulted.Parameters: - changes – Dict containing changes to the configuration.
- defaults – List of dicts containing the default configuration.
-
changes= None¶
-
defaults= None¶
-
iteritems()¶
-
iterkeys()¶
-
itervalues()¶
ExceptionInfo¶
-
class
celery.datastructures.ExceptionInfo(exc_info=None, internal=False)[source]¶ Exception wrapping an exception and its traceback.
Parameters: exc_info – The exception info tuple as returned by sys.exc_info().-
exception= None¶ Exception instance.
-
internal= False¶ Set to true if this is an internal error.
-
traceback= None¶ String representation of the traceback.
-
type= None¶ Exception type.
-
LimitedSet¶
-
class
celery.datastructures.LimitedSet(maxlen=None, expires=None, data=None, heap=None)[source]¶ Kind-of Set with limitations.
Good for when you need to test for membership (a in set), but the set should not grow unbounded.
Parameters: - maxlen – Maximum number of members before we start evicting expired members.
- expires – Time in seconds, before a membership expires.
-
add(key, now=<built-in function time>, heappush=<built-in function heappush>)[source]¶ Add a new member.
-
pop_value(value)¶ Remove membership by finding value.
LRUCache¶
-
class
celery.datastructures.LRUCache(limit=None)[source]¶ LRU Cache implementation using a doubly linked list to track access.
Parameters: limit – The maximum number of keys to keep in the cache. When a new key is inserted and the limit has been exceeded, the Least Recently Used key will be discarded from the cache. -
iteritems()¶
-
iterkeys()¶
-
itervalues()¶
-