multi request handling parallelly by using flask

1.3k views Asked by At
@app.route("/")
def start():
    #will do some task
    return 'completed'

In the above program, after execution the 1st request 2nd request will execute. But I want to make such a server that will accept, execute and response multiple requests at a certain time parallelly by using flask or anything else.

How will I make this?

2

There are 2 answers

2
SaiNageswar S On

For multi-request handling/production deployment, gunicorn or apache or gevent has to be used.

http://flask.pocoo.org/docs/0.11/deploying/

Similar approach follows for other python web frameworks too like Django.

9
Karthikeyan KR On

You can use klein module, which handle multiple requests in a time.

  • Please refer the following lin which will give clear explanation about limiting in FLASK.

Comparison between Flask and Klein

After refering this link I switched from Flask to Klein. Hope it helps you too.