-
Notifications
You must be signed in to change notification settings - Fork 89
Add TTL versions of UpdateAsync/TryUpdateAsync to INatsKvStore #852
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
Conversation
Signed-off-by: Caleb Lloyd <[email protected]>
|
sorry for the delay on this one @caleblloyd. i'm guessing it's for extending the ttl i.e. sliding expirations? I'm not sure if this works as expected. btw is this same subject would you say? #831 (comment) |
|
Yes, for sliding window updates. I think it is working fine here, had to cast to the concrete implementation though: |
|
ah ok. so just to double check, is it doing what it's supposed to do? cause my understanding is that sliding expiration wasn't supported by the server |
|
True, I don't think sliding expiration is technically supported by the server. But it can be achieved by doing a Get, followed by an Update with Optimistic Concurrency Control on the revision that was retrieved, sending the exact same value back with a new TTL. This PR is exposing the They would be useful for anyone using the interface who wants to do an update with Optimistic Concurrency Control and a TTL, not just for sliding expiration. It's more of an interface parity change than anything new... For example the TTL versions of |
|
There is a suggestion against put here https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-48.md#storing-values |
mtmk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Expose the ttl-versions of update