This document describes Celery 2.4. For development docs, go here.
Custom types and data structures.
copyright: |
|
---|---|
license: | BSD, see LICENSE for more details. |
Token Bucket Algorithm.
See http://en.wikipedia.org/wiki/Token_Bucket Most of this code was stolen from an entry in the ASPN Python Cookbook: http://code.activestate.com/recipes/511490/
Thread safety
This implementation may not be thread safe.
Returns True if tokens number of tokens can be consumed from the bucket.
Maximum number of tokensin the bucket.
Returns the expected time in seconds when a new token should be available.
Warning
This consumes a token from the bucket.
The rate in tokens/second that the bucket will be refilled
Timestamp of the last time a token was taken out of the bucket.
Dict subclass with attribute access.
Adds attribute access to mappings.
d.key -> d[key]
A view over an applications configuration dicts.
If the key does not exist in changes, the defaults dict is consulted.
Parameters: |
|
---|
Exception wrapping an exception and its traceback.
Parameters: | exc_info – The exception info tuple as returned by sys.exc_info(). |
---|
Exception instance.
String representation of the traceback.
Exception type.
Kind-of Set with limitations.
Good for when you need to test for membership (a in set), but the list might become to big, so you want to limit it so it doesn’t consume too much resources.
Parameters: |
|
---|
Add a new member.
Remove all members
Get the oldest member.
Remove membership by finding value.
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. |
---|