-
Notifications
You must be signed in to change notification settings - Fork 809
Add InvokeAsync with cancellation token overload to IJSRuntime #1915
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 InvokeAsync with cancellation token overload to IJSRuntime #1915
Conversation
/// <param name="args">JSON-serializable arguments.</param> | ||
/// <param name="cancellationToken">A cancellation token to signal the cancellation of the operation.</param> | ||
/// <returns>An instance of <typeparamref name="TValue"/> obtained by JSON-deserializing the return value.</returns> | ||
Task<TValue> InvokeAsync<TValue>(string identifier, IEnumerable<object> args, CancellationToken cancellationToken = default); |
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.
What's the contract of this? Does providing a cancellation token override the default timeout? What if they pass default
? Does that still override the timeout?
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.
- No cancellation token (params overload) uses the default timeout.
- Passing a cancellation token overrides the default timeout.
- Passing the default means no timeout
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.
Then this needs to be non-default parameter since the decision to pass a CT is really significant. There's a really important difference between these overloads.
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.
Fair enough, I'll send another PR
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.
I think we should get an ack from @GrabYourPitchforks as well (don't have to block on that).
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.
We can review that on the meeting next week.
…t/extensions#1915) Adds the InvokeAsync with cancellation token overload to IJSRuntime\n\nCommit migrated from dotnet/extensions@55f0b77
…t/extensions#1915) Adds the InvokeAsync with cancellation token overload to IJSRuntime\n\nCommit migrated from dotnet/extensions@55f0b77
No description provided.