Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic expire config like expire_callback or expired_at #187

Open
sawaca96 opened this issue Aug 16, 2022 · 0 comments
Open

Dynamic expire config like expire_callback or expired_at #187

sawaca96 opened this issue Aug 16, 2022 · 0 comments

Comments

@sawaca96
Copy link

I think it would be nice if I could determine the expiration in more various ways or dynamically .

use expire callback

def get_expire():
  # return seconds
  ...

@ring.lru(expire_callback=get_exprie())
def foo():
  return "foo"

use expired_at

expired_at can be cron expressoin or time or datetime.

I think cron expression is very nice.

time and datetime is ambiguous, because it cannot be repeated and can only be used once.

@ring.lru(expired_at=expired_at)
def foo():
  return "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant