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

celery.utils.dispatch.saferef

“Safe weakrefs”, originally from pyDispatcher.

Provides a way to safely weakref any function, including bound methods (which aren’t handled by the core weakref module).

celery.utils.dispatch.saferef.safe_ref(target, on_delete=None)[源代码]

Return a safe weak reference to a callable target

参数:
  • target – the object to be weakly referenced, if it’s a bound method reference, will create a BoundMethodWeakref, otherwise creates a simple weakref.ref.
  • on_delete – if provided, will have a hard reference stored to the callable to be called after the safe reference goes out of scope with the reference object, (either a weakref.ref or a BoundMethodWeakref) as argument.

上一个主题

celery.utils.dispatch.signal

下一个主题

celery.platforms

本页