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

Allow IDisposable or IAsyncDisposable to be implemented by RPC interfaces #447

Closed
AArnott opened this issue Apr 6, 2020 · 0 comments
Closed
Assignees
Milestone

Comments

@AArnott
Copy link
Member

AArnott commented Apr 6, 2020

When defining an RPC interface for use in GetProxy<T>, an exception is thrown if T derives from IDisposable because all methods must be asynchronous.

Since the returned proxy actually does implement IDisposable (in terms of disposing the connection), it is important that users of these proxies recognize that the returned object implements IDisposable and dispose of them.

Let's support (and encourage!) RPC interfaces to derive from IDisposable or IAsyncDisposable and document that doing so leads to a local disposal rather than forwarding as an RPC call to the remote side.

@AArnott AArnott self-assigned this Apr 6, 2020
@AArnott AArnott added this to the v2.4 milestone Apr 6, 2020
AArnott added a commit to AArnott/vs-streamjsonrpc that referenced this issue Apr 6, 2020
@AArnott AArnott closed this as completed Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant