Skip to content

Add atomic "Get and Set" method#117

Merged
coocood merged 2 commits intocoocood:masterfrom
padjoo:feature/getandset
Oct 25, 2022
Merged

Add atomic "Get and Set" method#117
coocood merged 2 commits intocoocood:masterfrom
padjoo:feature/getandset

Conversation

@padjoo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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