Eager tasks are a new feature and a library I have developed few years ago is not compatible with it. However, it would be nice if my code could coexist in one program with asyncio code using this feature. Lazy tasks for me, eager tasks for them, if they prefer.
How can I create a task scheduled the standard (old) lazy way no matter what kind of task factory is set as default?
The Task object itself has a corresponding option:
class asyncio.Task(coro, *, loop=None, name=None, context=None, eager_start=False)
^^^^^^^^^^^
but the docs say:
Use the high-level asyncio.create_task() function to create Tasks, or
the low-level loop.create_task() or ensure_future() functions. Manual
instantiation of Tasks is discouraged.
But all these high-level function lack the eager_start
option. I think the documentation of the eager task scheduling could be improved. Could you please help?
2