async-lru icon indicating copy to clipboard operation
async-lru copied to clipboard

Expires

Open Artimi opened this issue 6 years ago • 9 comments

Thank you for this great package!

What do these changes do?

This change adds keyword argument expires as discussed in https://github.com/aio-libs/async_lru/pull/50#issuecomment-487609639. In comparison with the other implementation this removes the key from the cache immediately after expires time passes. This way it saves the space earlier and we don't have to deal with special cases with maxsize (if we don't call the coroutine with the same arguments again the already expired item would take place in _cache forever or until it is removed by least recently used principle.

Are there changes in behavior for the user?

Everything behaves in the same manner plus user can use the new keyword argument.

Related issue number

This PR has no issue number.

Checklist

  • [x] I think the code is well written
  • [x] Unit tests for the changes exist
  • [x] Documentation reflects the changes

Artimi avatar May 01 '19 08:05 Artimi

Please read https://github.com/aio-libs/async_lru/pull/50#issuecomment-488439057

asvetlov avatar May 01 '19 21:05 asvetlov

I updated the PR so it passes code style check. @hellysmile what do you think about arguments I stated in https://github.com/aio-libs/async_lru/pull/50#issuecomment-488565406?

Artimi avatar May 20 '19 11:05 Artimi

Codecov Report

Merging #131 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #131   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         136    138    +2     
  Branches       24     25    +1     
=====================================
+ Hits          136    138    +2
Impacted Files Coverage Δ
async_lru.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ba653e8...d2e085f. Read the comment docs.

codecov[bot] avatar May 20 '19 11:05 codecov[bot]

Hello. Is this ever going to be merged?

d-ryzhykau avatar Jan 01 '20 15:01 d-ryzhykau

Would love to see this merged as well!

cancan101 avatar Oct 27 '20 00:10 cancan101

I don't think this will get ever merged. We forked the repo and released it in our internal system.

Artimi avatar Oct 27 '20 13:10 Artimi

@Artimi any plans to publish to pypi?

cancan101 avatar Oct 27 '20 18:10 cancan101

No, we have it locally and we don't want to maintain the package.

Artimi avatar Oct 28 '20 11:10 Artimi

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Petr Šebek seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 16 '20 10:11 CLAassistant

Implemented by c46ada7

asvetlov avatar Feb 19 '23 13:02 asvetlov