Skip to content Skip to sidebar Skip to footer

How Do I Run Background Job In Flask Without Threading Or Task-queue

I am building REST API with Flask-restplus. One of my endpoints takes a file uploaded from client and run some analysis. The job uses up to 30 seconds. I don't want the job to bloc

Solution 1:

I would HIGHLY recommend using Celery as you have already mentioned in your post. It is built exactly for this use case. Their docs are really informative and there are no shortage of examples online that can get you up and running quickly.

Additionally, I would say THIS would be an excellent first resource for you to start with.

Solution 2:

Celery is a fantastic solution to this problem I have used quite successfully in the past to manage millions of jobs per day.

The only real downside is the initial learning curve and complexity of debugging when things go sour (it can happen, especially with millions of jobs).

Post a Comment for "How Do I Run Background Job In Flask Without Threading Or Task-queue"