I developed an API with Bottle and some requests takes long time to send the response, the problem is if during this time I send another short request, I have to wait until the first request is finished.
Here is an example :
from gevent import monkey
monkey.patch_all()
from bottle import route, run
@route('/test', method='GET')
def test():
return 'hello'
@route('/loop', method='GET')
def loop():
for i in range(0, 1000000000):
a = 0
if __name__ == '__main__':
run(host='127.0.0.1', port=45677, debug=True, server='gevent')
If you run /loop and then /test you will have to wait until the /loop is finished to get the /test response.
I tried with many server, always the same problem.
What I'm doing wrong ? Thank you for your help.