I used to have a function like this
def calculate(self, input):
result = input * 2
if result > 4:
result_higher_then_four.send(result)
return result
Where result_higher_then_four obviously represents a signal.
Then I introduced celery and my function looked like below and I never received a signal again. I suppose signals are bound per process and as celery runs in a different process, this means I cannot catch the signal in the main process. Should I use a thread_local to fix this? Or am I overlooking the obvious?
Thanks
@task
def calculate(self, input):
result = input * 2
if result > 4:
result_higher_then_four.send(result)
return result