启动异步循环“分离”

时间:2020-06-16 09:57:12

标签: python-3.x python-asyncio

module.py

queue = asyncio.Queue

async def foo()
   while True:
       val = await queue.get()
       someprocessing(val)

def bar(val)
     queue.put_no_wait(val)

我想从模块外部调用bar方法,并异步处理获得的值。我还需要什么其他初始化?

0 个答案:

没有答案