-
Notifications
You must be signed in to change notification settings - Fork 97
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
Feature Request: Floating-Point ttl #149
Comments
It's not currently possible, but I'd be happy to accept a PR if you can get to it before I have time to work on it. It would be pretty straightforward to add support to the |
@jaemk What should be done about the following functions to allow subsecond TTL?
New versions of all of these could be created with the ability to pass in a lifespan with additional subsecond_nanos, but the function names seem to get quite long and redundant. It also seems beneficial to switch the internal representation of the lifespan to a Duration. |
Although breaking changes aren't the prettiest, it seems like the best way forward is for the macros to accept a The upgrade path is relatively straight forward™️ (happy to contribute a codemod if wanted) - #[cache(time = 1)]
+ #[cache(time = Duration::from_secs(1))] |
Just to add some notes here:
|
I'd love to use this library for very short caching intervals (eg 10-50ms), but ttl only supports integer seconds. I'm currently looking into a way to do this more manually, but are there any ways to conveniently use a subsecond ttl?
I'm not sure if it's possible to add this feature without breaking existing code, either.
The text was updated successfully, but these errors were encountered: