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 versions of KV commands that don't throw exceptions? #441

Open
darkwatchuk opened this issue Mar 11, 2024 · 1 comment
Open

Add versions of KV commands that don't throw exceptions? #441

darkwatchuk opened this issue Mar 11, 2024 · 1 comment

Comments

@darkwatchuk
Copy link
Contributor

Proposed change

Add versions of KV commands that don't throw exceptions. Throwing exceptions in all cases when you're just interested in the outcome of an operation seems a bit overkill?

Use case

Some good uses for KV stores including leader election where we regularly try and get a lock on a resource. So a TryCreateAsync call where we get a bool might be better than calling CreateAsync and getting exceptions thrown constantly from the API. We may call this method every 1-3 seconds...

Likewise, just being interested in whether a kv pair exists or not might not need exceptions thrown all the time?

Contribution

Happy to look at this if can agree on the signatures...

@mtmk
Copy link
Collaborator

mtmk commented Mar 11, 2024

sounds reasonable to me. Once we establish a pattern we should potentially apply this to other JetStream APIs.

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

No branches or pull requests

2 participants