how to manage requests in a queue to a Flask server?

Viewed 1191

I am working on building a simple Flask server which is going to provide a compilation service to a small group of people.

One can connect to the server using a url, enter his function code to a </textarea> and then hit a "submit" button that is going to compile the code in the background and then display it on another </textarea> on the same page. Each such compilation request might take few minutes, so I was thinking that I will need some queue to store those users' requests in case some users are making requests simultaneously. What is the best way to do that? Should I create a Lib/Queue and manage everything manually, the queueing the callback afterwards and so forth?

I assume there is some know methodology for queueing such requests made to a server which is simply don't know. I don't think i need to re-invent the wheel here.

1 Answers

I think you need celery to do task queue as async task.

Related