如何将芹菜与线一起使用



出于某些原因,我正在使用Android手机进行开发。现在我正在积极从事一个项目。在这个项目中,我需要使用芹菜(任务队列(python和django。不幸的是,Android平台没有提供具有sem_open和sem_lock功能的多处理。当我尝试它时,我收到以下错误

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/synchronize.py", line 32, in <module>
" synchronization primitives needed will not" +
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

在搜索了我可以使用的多处理之后,我读到我可以尝试使用线程。这是我的问题是否可以将芹菜与线程一起使用而不是多处理?如果是,我应该从哪里开始。

这些是 Celery 4.x 中的并发类型,以及处理它们的关联类:

'prefork': 'celery.concurrency.prefork:TaskPool',
'eventlet': 'celery.concurrency.eventlet:TaskPool',
'gevent': 'celery.concurrency.gevent:TaskPool',
'solo': 'celery.concurrency.solo:TaskPool',
'processes': 'celery.concurrency.prefork:TaskPool',  # XXX compat alias

那里没有线程,所以我假设它要么被删除,要么从未支持。

最新更新