-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Description
Since Python 3.12, asyncio introduced an eager task factory, which allows tasks to start executing immediately after being spawned, rather than waiting until the event loop schedules them.
I believe this could be useful in cases where the coroutine is just a simple cached value getter. Using eager tasks could reduce latency in situations where:
- The coroutine would otherwise be scheduled at the end of the queue, delaying an immediate result.
- Some other coroutines are blocking by mistake, and we’d still want cache hits to return quickly.
It's just an idea, but the implementation seems fairly straightforward. If no one else wants to try doing it, I will open a PR in 1-2 months, things have been pretty busy lately
Metadata
Metadata
Assignees
Labels
No labels