I have developed a REST server using Flask in python and currently it is built in synchronous manner. next request is processed only after completion of existing request and sometimes this is increasing response time. Most of the processing is network dependent and takes few seconds. What are the best ways to handle ie fork so that I can handle multiple requests simultaneously.
@app.route('call', methods = ['POST'])
def create_task2():
result = process(request) # takes around 5 seconds
return jsonify( result ), 201
When 2 request are sent to my restserver simultaneously, 2nd one has to wait for atleast 10 seconds before receiving the response. I want to use this as a restserver catering requests to external users