How to run an asynchronous task in a flash application (without using the MQ rabbit in the celery)

I just need to run the async task after calling the route. The response should be returned after starting the task. How can I do this without using RabbitMQ and Celery in python.

@app.route('/preprocess')
def pre_process():
    thr = threading.Thread(target=PreProcessor().initiate_preprocess_task())
thr.start()
return "Pre-process task initiated!"

if __name__ == '__main__':
    app.run(threaded=True, use_reloader=True)
+4
source share

Source: https://habr.com/ru/post/1673005/


All Articles