ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
在fastapi ,uvloop使用异步函数
使用异步的时候 ‘coroutine’ object is not iterable错误
原来发现,是同步函数中调用异步代码,
请在外面函数中加上async ,await
这篇博客探讨了在使用FastAPI和uvloop进行异步编程时遇到的错误——'coroutine' object is not iterable。文章指出问题源于在同步函数内部调用了异步代码,解决方案是在外部函数中正确使用`async`和`await`关键字。通过理解异步编程的概念和正确使用异步语法,可以避免此类错误,确保FastAPI应用的顺利运行。
ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
在fastapi ,uvloop使用异步函数
使用异步的时候 ‘coroutine’ object is not iterable错误
原来发现,是同步函数中调用异步代码,
请在外面函数中加上async ,await
1178

被折叠的 条评论
为什么被折叠?
