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 other client extensions #637

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Add other client extensions #637

wants to merge 12 commits into from

Conversation

mtmk
Copy link
Collaborator

@mtmk mtmk commented Sep 23, 2024

Refactor to use interfaces for enhanced flexibility and testability across various components like NatsJSContext and NatsConnection. Added new extension methods to easily create contexts for Object Store, Key-Value Store, and Services on NATS client and connection instances.

await using var client = new NatsClient();

// Use KeyValueStore extension method by referencing NATS.Client.KeyValueStore package
INatsKVContext kv = client.CreateKeyValueStoreContext();

// Use ObjectStore extension method by referencing NATS.Client.ObjectStore package
INatsObjContext obj = client.CreateObjectStoreContext();

// Use Services extension method by referencing NATS.Client.Services package
INatsSvcContext svc = client.CreateServicesContext();

Refactor to use interfaces for enhanced flexibility and testability across various components like NatsJSContext and NatsConnection. Added new extension methods to easily create contexts for Object Store, Key-Value Store, and Services on NATS client and connection instances.
Updated INatsObjStore, INatsKVContext, and INatsSvcContext interfaces to include public `Context` properties. This change ensures consistent access to the underlying context objects across various components.
@mtmk mtmk changed the title Other client extensions Add other client extensions Sep 23, 2024
@rickdotnet
Copy link
Collaborator

🙌 looking forward to this!

Copy link
Collaborator

@rickdotnet rickdotnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. All comments are thought provoking.

src/NATS.Client.KeyValueStore/INatsKVContext.cs Outdated Show resolved Hide resolved
src/NATS.Client.KeyValueStore/NatsClientExtensions.cs Outdated Show resolved Hide resolved
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.

INatsClient Services API extensions INatsClient Object Store API extensions INatsClient KV API extensions
2 participants