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

CreateOrUpdateStoreAsync? #698

Open
aradalvand opened this issue Dec 19, 2024 · 3 comments
Open

CreateOrUpdateStoreAsync? #698

aradalvand opened this issue Dec 19, 2024 · 3 comments

Comments

@aradalvand
Copy link

Proposed change

Add a CreateOrUpdateStoreAsync to INatsKVContext, analogous to CreateOrUpdateConsumerAsync on INatsJSStream and CreateOrUpdateStreamAsync on INatsJSContext (which was recently added).

Use case

Similar to CreateOrUpdateConsumer, CreateOrUpdateStreamAsync, and the rest.

Contribution

No response

@Ivandemidov00
Copy link
Contributor

Hi!
There is no such thing in the go client, but it doesn't look like a difficult improvement.
For example - ValueTask<INatsKVStore> CreateOrUpdateStoreAsync(NatsKVConfig configuration, CancellationToken CancellationToken = default)
I can do it if no one has any objections.

@mtmk
Copy link
Collaborator

mtmk commented Jan 6, 2025

@Ivandemidov00 it looks like it is in Go client already, no?
https://github.com/nats-io/nats.go/blob/main/jetstream/kv.go#L551

edit: if you agree as well that Go implementation is the equivalent call, please feel free to go ahead and open a PR 👍

edit2: also thanks @aradalvand for the suggestion.

@Ivandemidov00
Copy link
Contributor

@mtmk it looks like I was originally looking at the KeyValueManager, which is part of the legacy JetStreamContext in nats.go. Now I saw the current API, thanks for the hint.

Ivandemidov00 pushed a commit to Ivandemidov00/nats.net.v2 that referenced this issue Jan 8, 2025
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 a pull request may close this issue.

3 participants