python - Celery --pool=threads -- 这是做什么的以及如何正确使用它?
问题描述
我在使用 Celery 运行任务时遇到了段错误。查找问题后,似乎其他人正在通过使用--pool=threads
.
当我尝试通过时,--pool=threads
我得到ModuleNotFoundError: No module named 'threads'
我不相信这thread
与会引发错误的模块相同No module named 'thread'
。
我如何开始使用线程,它有什么作用?
Celery 站点中的相关文档--pool=threads
非常少。搜索“--pool”不会返回任何实质性内容,除了与台球有关的内容
解决方案
如果你想使用线程作为你的执行池,你可以在 eventlet 和 gevent 之间进行选择。
http://docs.celeryproject.org/en/latest/reference/celery.bin.worker.html#cmdoption-celery-worker-p
您需要使用pip install
eventlet/gevent 才能使其工作。
推荐阅读
- java - java - 如何以时区为输入在没有服务器时间的情况下获取正确的日期和时间
- scala - 有没有办法在远程环境中的 Intellij 中运行 scala 表?
- python - 将熊猫数据框列映射到字典
- r - 按组重复序列
- python - 查找坐标以在显示器上随机分布图像而不会重叠
- javascript - 目标时约束 orbitControls maxDistance,THREE.js
- go - 去切片-结束后不要惊慌
- applescript - 设置自定义应用程序图标时,AppleScript 应用程序的代码签名不起作用
- c# - 如何为后台工作人员传递函数?
- android - android libuv 使用未声明的标识符'EPOLL_CLOEXEC'