【发布时间】:2021-03-29 23:50:58
【问题描述】:
我的烧瓶项目有这个配置:
在requrement.txt中:
flask_socketio
eventlet
在我的 app.py 中:
from flask_socketio import SocketIO
socketio = SocketIO(app, async_mode="eventlet")
@socketio.on('register')
async def register(data):
await my_asyncfunction(data['machine_id'])
和 my_asyncfunction:
async def my_asyncfunction(data):
....
这是我的错误:
/usr/local/lib/python3.7/threading.py:870: RuntimeWarning: coroutine 'my_asyncfunction' 从未等待 self._target(*self._args, **self._kwargs)RuntimeWarning: Enable tracemalloc 获取对象分配回溯
所以我尝试了async_mode="eventlet" 选项但同样的错误:(
【问题讨论】:
标签: python flask-socketio eventlet