Kevin Conway <kevinjacobcon...@gmail.com>: > If you're handling coroutines there is an asyncio facility for > "background tasks". The ensure_future [1] will take a coroutine, > attach it to a Task, and return a future to you that resolves when the > coroutine is complete.
Ok, yes, but those "background tasks" monopolize the CPU once they are scheduled to run. If your "background task" doesn't need a long time to run, just call the function in the foreground and be done with it. If it does consume time, you need to delegate it to a separate process so the other tasks remain responsive. Marko -- https://mail.python.org/mailman/listinfo/python-list