Celery v0.8.1 (stable) documentation
Custom Datastructures
Exception wrapping an exception and its traceback.
Parameter: | exc_info – The exception tuple info as returned by traceback.format_exception(). |
---|
A positional queue of a specific length, with slots that are either filled or unfilled. When all of the positions are filled, the queue is considered full().
Parameter: | length – see length. |
---|
An integer that can be updated by several threads at once.
Please note that the final value is not synchronized, this means that you should not update the value by using a previous value, the only reliable operations are increment and decrement.
Example
>>> max_clients = SharedCounter(initial_value=10)# Thread one >>> max_clients += 1 # OK (safe)
# Thread two >>> max_clients -= 3 # OK (safe)
# Main thread >>> if client >= int(max_clients): # Max clients now at 8 ... wait()
>>> max_client = max_clients + 10 # NOT OK (unsafe)