(Redirecting the discussion back to the list.)

On Thu, Feb 27, 2014 at 10:46 AM, Kelketek Rritaa <[email protected]>wrote:

> [...]
> But yes. I should certainly give examples on when it might be useful.
>
> Say you're working with another library. You might know that the library
> occasionally does something that changes state, but you either don't trust
> that library's code to make that change easily accessed by an AsyncIO task,
> or you just find it easier to read and maintain to add an idle task that
> occasionally cleans things up or updates things according to that other
> library's work.
>
> Alternatively, you might just have cleanup tasks that need to do x, y, and
> z, and adding an extra call to the end of every task to run the cleanup
> routine would result in repeated code that could just be taken care of at
> the end of the loop.
>

Hm... Do you have specific examples of these? In either case it would seem
likely that the idle task could do a lot of extra work -- it will run
whenever the loop is about to go idle, whether or not there is anything to
clean up or update.

-- 
--Guido van Rossum (python.org/~guido)

Reply via email to