hephex / asyncache

Helpers to use cachetools with async functions
MIT License
90 stars 12 forks source link

await pending future #21

Open makeroo opened 6 months ago

makeroo commented 6 months ago

It's a possible solution for https://github.com/hephex/asyncache/issues/2

When invoking the same cached func multiple times, if the future returned by the first call is still pending then wait for it instead of triggering a new call.

Note: do not cache errors. When the call fails, the future is removed from the cache.

Note 2: this behaviours should be customizable (ie. error handling, multiple calls, etc.)