Hello all,

I have a question related to AsyncIO. I have a while True: loop that
executes a list of tasks asynchronously every 10 seconds.

while True:
>     loop = asyncio.get_event_loop()
>     tasks = [ ]
>     for arg in args:
>         tasks.append(asyncio.ensure_future(my_coroutine(arg)))
>     results = [ ]
>     results = loop.run_until_complete(gather(*tasks))
>     print(results)
>     sleep(10)
>


Now how can I achieve the same outcome with loop.run_forever()?

What I want to achieve is to have a loop.run_forever() in my main(). Then
periodically, a list of tasks will be added to that event_loop for
execution.

Please enlighten me.

Thank you.
An.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to