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

Add atomic "Get and Set" method #117

Merged
merged 2 commits into from
Oct 25, 2022
Merged

Conversation

padjoo
Copy link
Contributor

@padjoo padjoo commented Oct 21, 2022

  • Adds an atomic Get plus Set method with a decider function to allow client to lookup value and decide on the new value (or leave as is).
  • This would allow use cases like Incr, Decr as well as more complicated flows where setting the value depends on the current value.

@padjoo padjoo changed the title Added GetAndSet method Add atomic "Get and Set" method Oct 21, 2022
@coocood
Copy link
Owner

coocood commented Oct 24, 2022

Thank you for the PR!
It's a very useful feature
How about rename it Update for the method and Updater for the function?

@coocood coocood merged commit 04ae1f1 into coocood:master Oct 25, 2022
@padjoo
Copy link
Contributor Author

padjoo commented Oct 25, 2022

Thanks @coocood!

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.

2 participants