aio-libs / aio-libs/aiocache

Utilise eager_task_factory in python >= 3.12

未關閉
#1,048 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
1.4k
分支
181
PR 合併指標
30 天內沒有已合併 PR

描述

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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。