Switched to list append for task wait
This commit is contained in:
parent
bd21d1501e
commit
6c1cc0bf9a
|
@ -64,6 +64,7 @@ def test(context, old_value, new_value):
|
|||
return True, status
|
||||
|
||||
async def main(loop):
|
||||
tasks = list()
|
||||
queues = dict()
|
||||
queues["hook"] = Queue()
|
||||
queues["push"] = Queue()
|
||||
|
@ -72,9 +73,9 @@ async def main(loop):
|
|||
await queues["hook"].put(test)
|
||||
await queues["push"].put(("test", "change", None, True))
|
||||
|
||||
yang = loop.create_task(pull(loop, queues))
|
||||
yin = loop.create_task(push(loop, queues))
|
||||
await wait([yin, yang])
|
||||
tasks.append(loop.create_task(pull(loop, queues)))
|
||||
tasks.append(loop.create_task(push(loop, queues)))
|
||||
await wait(tasks)
|
||||
loop.stop()
|
||||
|
||||
loop = get_event_loop()
|
||||
|
|
Loading…
Reference in New Issue