celery._state

Internal state.

This is an internal module containing thread state like the current_app, and current_task.

This module shouldn’t be used directly.

celery._state.connect_on_app_finalize(callback)[исходный код]

Connect callback to be called when any app is finalized.

celery._state.current_app = <Celery default>

Proxy to current app.

celery._state.current_task = None

Proxy to current task.

celery._state.get_current_app()[исходный код]
celery._state.get_current_task()[исходный код]

Currently executing task.

celery._state.get_current_worker_task()[исходный код]

Currently executing task, that was applied by the worker.

This is used to differentiate between the actual task executed by the worker and any task that was called within a task (using task.__call__ or task.apply)

celery._state.set_default_app(app)[исходный код]

Set default app.

Back to Top