-
Notifications
You must be signed in to change notification settings - Fork 152
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 JsonRpcTargetOptions.DisposeOnDisconnect #450
Conversation
Codecov Report
@@ Coverage Diff @@
## v2.4 #450 +/- ##
==========================================
- Coverage 90.54% 90.51% -0.03%
==========================================
Files 49 49
Lines 3732 3752 +20
==========================================
+ Hits 3379 3396 +17
- Misses 353 356 +3
Continue to review full report at Codecov.
|
src/StreamJsonRpc/JsonRpc.cs
Outdated
} | ||
else if (target is IDisposable disposableTarget) | ||
{ | ||
this.Disconnected += (s, e) => disposableTarget.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we forget the async tasks, does it change the exception behavior between sync/async dispose cases? I don't remember what happens if you have a Task returning async method but don't await the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They just get dropped on the floor. However in retrospect I guess we could report any exceptions in the JsonRpc.Completion
Task.
Also invoke target.Dispose on its SynchronizationContext.
Closes #448