How to make flask response to client asynchronously?

前端 未结 2 2411
借酒劲吻你
借酒劲吻你 2021-02-20 19:02

Flask is a single thread web server. But I want to make it won\'t block when handle some time consuming request.

For example:

from flask import Flask
imp         


        
2条回答
  •  清歌不尽
    2021-02-20 19:38

    This snippet is a good starting point.

    You also should look into Celery or RQ, they're the right thing to use for larger projects, more importantly they're not Flask-specific.

    They also have Flask integration each, Flask-Celery and Flask-RQ.

提交回复
热议问题