This is a cross-post from the mailing list, hoping to get more eyes on the question. (original post)
When using running celery worker -p eventlet
, does Celery do automatic monkey-patching of my code?
The docs don't mention anything about having to do patching and the official example doesn't do any explicit patching as well (even the gevent example doesn't do any patching). The example hints at patching being done automatically, but there is no explicit/definite answer.
When you run celery worker
the function execute_from_commandline
calls celery.__init__.maybe_patch_concurrency
which calls _patch_eventlet
which does:
def _patch_eventlet():
import eventlet
import eventlet.debug
eventlet.monkey_patch()
blockdetect = float(os.environ.get('EVENTLET_NOBLOCK', 0))
if blockdetect:
eventlet.debug.hub_blocking_detection(blockdetect, blockdetect)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With