当然,您只需要从主要部署的功能运行异步功能(在这里,您将部署test
功能):
import asyncio
async def foo():
return 'Asynchronicity!'
async def bar():
return await foo()
def test(request):
return asyncio.run(bar())
可以或如何在Google Cloud Functions上使用Python asyncio?
当然,您只需要从主要部署的功能运行异步功能(在这里,您将部署test
功能):
import asyncio
async def foo():
return 'Asynchronicity!'
async def bar():
return await foo()
def test(request):
return asyncio.run(bar())