hephex / asyncache

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

Await pending future #2

Open cancan101 opened 3 years ago

cancan101 commented 3 years ago

The library does not seem like access to the cache awaits pending future like this library does: https://github.com/aio-libs/async-lru/blob/ae252508f9c5aecf9c02ddeb879d06c28dbffc42/async_lru.py#L150

This means that when I try to call my function multiple times, subsequent runs are not awaiting the prior future.

The issue seems to be here where the future should be inserted into the dict before awaiting: https://github.com/hephex/asyncache/blob/27ec0ad90ccb2a86ffaa8dcf55bb388059b484a0/asyncache/__init__.py#L57-L61

Benoss commented 2 days ago

Is there another library or fork that has this behaviour?