-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add support for cancelling regular hub invocations from client #64098
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
84205e7
db1c426
c618b86
e410c32
5e1f150
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -53,11 +53,11 @@ public static void SendingResult(ILogger logger, string? invocationId, ObjectMet | |||||
[LoggerMessage(9, LogLevel.Trace, "'{HubName}' hub method '{HubMethod}' is bound.", EventName = "HubMethodBound")] | ||||||
public static partial void HubMethodBound(ILogger logger, string hubName, string hubMethod); | ||||||
|
||||||
[LoggerMessage(10, LogLevel.Debug, "Canceling stream for invocation {InvocationId}.", EventName = "CancelStream")] | ||||||
public static partial void CancelStream(ILogger logger, string invocationId); | ||||||
[LoggerMessage(10, LogLevel.Debug, "Canceling invocation {InvocationId}.", EventName = "CancelInvocation")] | ||||||
|
||||||
public static partial void CancelInvocation(ILogger logger, string invocationId); | ||||||
|
||||||
[LoggerMessage(11, LogLevel.Debug, "CancelInvocationMessage received unexpectedly.", EventName = "UnexpectedCancel")] | ||||||
public static partial void UnexpectedCancel(ILogger logger); | ||||||
[LoggerMessage(11, LogLevel.Debug, "CancelInvocationMessage received for {InvocationId} but invocation was not found.", EventName = "UnexpectedCancel")] | ||||||
|
[LoggerMessage(11, LogLevel.Debug, "CancelInvocationMessage received for {InvocationId} but invocation was not found.", EventName = "UnexpectedCancel")] | |
[LoggerMessage(11, LogLevel.Debug, "CancelInvocationMessage received for {InvocationId} but invocation or stream was not found.", EventName = "UnexpectedCancel")] |
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.
Done in commit 0ad2858. Created a new log method UnexpectedCancelWithId
(ID 27) with the suggested message "...invocation or stream was not found." to avoid changing the existing EventName.
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.
Looks like this code is the exact same as the code used for streaming. We should extract it into a private method and call that method from here and the streaming method.
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.
Done in commit 0ad2858. Extracted the duplicate cancellation logic into a
CancelInvocationAsync
private method that's now used by bothInvokeCoreAsyncCore
andStreamAsChannelCoreAsyncCore
.