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

rawkv: add TTL argument for client method CompareAndSwap #943

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tutububug
Copy link

No description provided.

Signed-off-by: tutububug <tutububug@hotmail.com>
@tutububug
Copy link
Author

to fix issue #371 .

@disksing
Copy link
Collaborator

Hi, @tutububug , can you make it an option so that it won't break the API?

@tutububug
Copy link
Author

tutububug commented Sep 18, 2023

Actually, in our use scenario, we use the CAS method to implement the distribute lock function.
The key names 'lock', and the value names 'locker'. Users can unlock a key only when its value equals the value the user passes. In normal cases, there is no problem, but when the locker client crashes, there should be a semantic 'lock timeout', so the TTL here needs to be used and added to the CAS parameters.

@Smityz
Copy link
Contributor

Smityz commented Feb 29, 2024

@disksing how about adding a new function CompareAndSwapTTL

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

Successfully merging this pull request may close these issues.

3 participants