gevent worker是否使用gunicornflask自动检测到I / O操作

问题描述

将gevent worker与gunicorn一起使用时,它会检测io操作并自动切换上下文吗?

考虑下面的代码段,获取请求会阻塞吗?

from flask import Flask
from requests_html import HTMLSession

session = HTMLSession()
app = Flask(__name__)

@app.route('/')
def hello_world():
    response = session.get("http://example.com")
    return response.html.find('title',first=True).text

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)