mardi 30 juin 2020

What is the proper way to thread tornado+flask app?

I made a web app with flask and ran it with flask's own web server with parameter 'threaded=True'. It worked perfectly.

app.run(host='0.0.0.0', port=5000, threaded=True)

But sooner I've found that it's only suitable for dev environment, so I decided to use 'tornado'. But it doesn't work concurrently.

http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()

Is there any parameter like 'threaded=True' of flask to thread? Or should I do it manually? If so, what is the proper way to do it?




Aucun commentaire:

Enregistrer un commentaire