处理Flask中的多个请求 [英] Handling multiple requests in Flask
问题描述
有什么方法可以让我的Flask应用程序接受是的,将您的应用程序部署在不同的WSGI服务器上,请参阅 //flask.pocoo.org/docs/deploying/rel =noreferrer> Flask部署选项文档。
Flask附带的服务器组件真的只是当你开发你的应用程序的时候,即使它可以配置为处理并发请求(使用 app.run(threaded = True)
)。上面的文档列出了几个可以处理并发请求的选项和,它们更健壮可调。
My Flask applications has to do quite a large calculation to fetch a certain page. While Flask is doing that function, another user cannot access the website, because Flask is busy with the large calculation.
Is there any way that I can make my Flask application accept requests from multiple users?
Yes, deploy your application on a different WSGI server, see the Flask deployment options documentation.
The server component that comes with Flask is really only meant for when you are developing your application; even though it can be configured to handle concurrent requests (with app.run(threaded=True)
). The above document lists several options for servers that can handle concurrent requests and are far more robust and tuneable.
这篇关于处理Flask中的多个请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!