Skip to content

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

Merged

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Jul 2, 2019

No description provided.

@javiercn javiercn requested a review from SteveSandersonMS July 2, 2019 16:39
@Eilon Eilon added the area-mvc label Jul 2, 2019
@javiercn javiercn merged commit 55f0b77 into master Jul 2, 2019
@ghost ghost deleted the javiercn/additional-ijsruntime-invokeasync-overload branch July 2, 2019 17:21
/// <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);
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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).

Copy link
Member Author

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.

JunTaoLuo pushed a commit to dotnet/aspnetcore that referenced this pull request Feb 12, 2020
…t/extensions#1915)

Adds the InvokeAsync with cancellation token overload to IJSRuntime\n\nCommit migrated from dotnet/extensions@55f0b77
JunTaoLuo pushed a commit to dotnet/aspnetcore that referenced this pull request Feb 15, 2020
…t/extensions#1915)

Adds the InvokeAsync with cancellation token overload to IJSRuntime\n\nCommit migrated from dotnet/extensions@55f0b77
@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants