celery.worker.state

celery.worker.state

Internal worker state (global)

This includes the currently active and reserved tasks, statistics, and revoked tasks.

celery.worker.state.SOFTWARE_INFO = {‘sw_sys’: ‘Linux’, ‘sw_ident’: ‘py-celery’, ‘sw_ver’: ‘3.1.7’}

Worker software/platform information.

celery.worker.state.reserved_requests = set([])

set of all reserved Request‘s.

celery.worker.state.active_requests = set([])

set of currently active Request‘s.

celery.worker.state.total_count = Counter()

count of tasks accepted by the worker, sorted by type.

celery.worker.state.revoked = LimitedSet(0)

the list of currently revoked tasks. Persistent if statedb set.

celery.worker.state.task_reserved()[源代码]

Update global state when a task has been reserved.

celery.worker.state.maybe_shutdown()

celery.worker.state.task_accepted(request, _all_total_count=[0])[源代码]

Updates global state when a task has been accepted.

celery.worker.state.task_ready(request)[源代码]

Updates global state when a task is ready.

celery.worker.state.task_reserved()[源代码]

Update global state when a task has been reserved.

celery.worker.state.task_ready(request)[源代码]

Updates global state when a task is ready.

class celery.worker.state.Persistent(state, filename, clock=None)[源代码]

This is the persistent data stored by the worker when --statedb is enabled.

It currently only stores revoked task id’s.

  • close()[源代码]

  • compress()

    compress(string[, level]) – Returned compressed string.

    Optional arg level is the compression level, in 1-9.

  • db None[源代码]

  • decompress()

    decompress(string[, wbits[, bufsize]]) – Return decompressed string.

    Optional arg wbits is the window buffer size. Optional arg bufsize is the initial output buffer size.

  • merge()[源代码]

  • open()[源代码]

  • protocol = 2

  • save()[源代码]

  • storage = <module ‘shelve’ from ‘/usr/lib/python2.7/shelve.pyc’>

  • sync()[源代码]