from celery import Celery
app = Celery('hello', broker='redis://localhost:6379/0')
id_task=''
@app.task(bind=True)
def testtask(self):
id_task=str(self.request.id)
while True:
pass
return 'ok'
def stoptask():
???? (task_id)