2024-09-27 07:31:03 发布
网友
是否可以在Google云函数上使用Python的asyncio?在
asyncio
async def handle_someting(): # do something some = await aiofunc() # Do I need the code below? loop = asyncio.get_event_loop() loop.run_until_complete(handle_someting()) loop.close()
当然,您只需要从主部署函数运行异步函数(在这里,您将部署test函数):
test
import asyncio async def foo(): return 'Asynchronicity!' async def bar(): return await foo() def test(request): return asyncio.run(bar())
当然,您只需要从主部署函数运行异步函数(在这里,您将部署
test
函数):相关问题 更多 >
编程相关推荐