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

ISubscription should inherit IDisposable #433

Closed
ColinSullivan1 opened this issue Feb 19, 2021 · 1 comment · Fixed by #438
Closed

ISubscription should inherit IDisposable #433

ColinSullivan1 opened this issue Feb 19, 2021 · 1 comment · Fixed by #438
Assignees

Comments

@ColinSullivan1
Copy link
Member

From a user:

Wouldn't it be better to make ISubscription inherit IDisposable rather than ISyncSubscription and IAsyncSubscription inherit both ISubscription and IDisposable individually? That way, if I want to maintain multiple subscriptions of both sync and async for a single connection where I keep all subscriptions as ISubscription in a dictionary keyed by subject, I have to cast appropriately to dispose all subscriptions when the connection close.

Would want to test to be sure an upgrade wouldn't break any code.

@watfordgnf
Copy link
Collaborator

I think this is a safe addition to the API. Our end users do not create instances of ISubscription's used by NATS, so the usual problems listed here do not apply:
https://docs.microsoft.com/en-us/dotnet/core/compatibility/

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.

2 participants