你正在阅读 Celery 3.1 的文档。开发版本文档见: 此处.

celery.utils.threads

celery.utils.threads

Threading utilities.

class celery.utils.threads.bgThread(name=None, **kwargs)[源代码]
body()[源代码]
on_crash(msg, *fmt, **kwargs)[源代码]
run()[源代码]
stop()[源代码]

Graceful shutdown.

class celery.utils.threads.Local[源代码]
celery.utils.threads.LocalStack

_LocalStack 的别名

class celery.utils.threads.LocalManager(locals=None, ident_func=None)[源代码]

Local objects cannot manage themselves. For that you need a local manager. You can pass a local manager multiple locals or add them later by appending them to manager.locals. Everytime the manager cleans up it, will clean up all the data left in the locals for this context.

The ident_func parameter can be added to override the default ident function for the wrapped locals.

cleanup()[源代码]

Manually clean up the data in the locals for this context.

Call this at the end of the request or use make_middleware().

get_ident()[源代码]

Return the context identifier the local objects use internally for this context. You cannot override this method to change the behavior but use it to link other context local objects (such as SQLAlchemy’s scoped sessions) to the Werkzeug locals.

celery.utils.threads.get_ident() → integer

Return a non-zero integer that uniquely identifies the current thread amongst other threads that exist simultaneously. This may be used to identify per-thread resources. Even though on some platforms threads identities may appear to be allocated consecutive numbers starting at 1, this behavior should not be relied upon, and the number should be seen purely as a magic cookie. A thread’s identity may be reused for another thread after it exits.

celery.utils.threads.default_socket_timeout(*args, **kwds)

上一个主题

celery.utils.sysinfo

下一个主题

celery.utils.timer2

本页