我以前有这样的功能
def calculate(self, input):
result = input * 2
if result > 4:
result_higher_then_four.send(result)
return result
其中result_higher_then_four
显然表示一个信号。
然后我介绍了芹菜,我的功能如下,我再也没有收到信号。我想每个进程都会绑定信号,因为芹菜在不同的进程中运行,这意味着我无法在主进程中捕获信号。我应该用thread_local
来解决这个问题吗?还是我忽略了显而易见的?
谢谢
@task
def calculate(self, input):
result = input * 2
if result > 4:
result_higher_then_four.send(result)
return result
目前没有回答
相关问题 更多 >
编程相关推荐