[SignalR] Possibility to cancel long running hub method from client

See original GitHub issue

I´m not quit sure if this post is more of a question or a feature request.

I noticed that the InvokeAsync<TResult>(HubConnection, String, CancellationToken) method accepts a CancellationToken. As far as I understood this token only cancels the invocation (and waiting for a result, …) on the client, while on the server side the method proceeds. Is this correct?

If so wouldn´t it be a nice feature to allow such a cancellation? I saw that Google offers this possibility in their gRPC framework aswell:

Cancelling RPCs Either the client or the server can cancel an RPC at any time. A cancellation terminates the RPC immediately so that no further work is done. It is not an “undo”: changes made before the cancellation will not be rolled back.

When my understanding is wrong please provide me an example on how to do a cancellation of long running hub methods from the client.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:10
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
muzoprahacommented, Mar 2, 2021

Hi, we need this functionality too. We have been waiting for this feature several months and one of our motivations for upgrading to .NET5 was this feature which was presented in .NET5 backlog. Now I see, it is not implemented yet 😕 Is there any ETA for this one? Thank you.

3reactions
davidfowlcommented, Jun 25, 2019

Today we only support cancellation for streams but there’s nothing wrong with supporting this for other invocations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SignalR] Possibility to cancel long running hub method ...
The scenario is, that our clients can run async heavy-weight server side operations (gathering data from other services) via SignalR. These ...
Read more >
SignalR just terminate single long running task among ...
I have been searching for right methodology to achieve this scenario without any luck. This is regarding multiple long running tasks to a ......
Read more >
Understanding and Handling Connection Lifetime Events ...
The relationship ends and SignalR disposes of the data when the client calls the Stop method or a timeout limit is reached while...
Read more >
SignalR deep dive: Key concepts, use cases, and limitations
The code snippet above demonstrates how to use three different hub methods: SendMessage sends a message to all connected clients.
Read more >
Optimizing Long-Running Tasks with Background Services ...
How to complete long-running tasks using hosted services and async notify clients using SignalR in a monolithic ASP.NET Core web app.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found