Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

How to know streaming is cancelled by Client in Hub Streaming Methods? #2597

Closed
windperson opened this issue Jul 5, 2018 · 6 comments
Closed
Assignees
Labels
cost: S Will take up to 2 days to complete PRI: 2 - Preferred Preferably should be handled during the milestone. status: Needs Design type: Bug
Milestone

Comments

@windperson
Copy link
Contributor

windperson commented Jul 5, 2018

Hi,
According to issue #898, Client can use cancellation token to ask for stopping streaming result from server,
On server-side, how do I know if the client surely send CancelInvocation message to request stopping streaming, so I can really end my Server-side application level task processing?

@analogrelay
Copy link
Contributor

I believe we don't expose this cancellation token to the Hub method. We will stop reading from the Channel you provide, but there isn't really a way to detect that in the Hub method. We can look at fixing this in a future release.

@analogrelay analogrelay added this to the 2.2.0 milestone Jul 5, 2018
@analogrelay analogrelay added cost: S Will take up to 2 days to complete type: Enhancement labels Jul 5, 2018
@windperson
Copy link
Contributor Author

Got it, thx!

@JanEggers
Copy link

are you accepting prs for this and if so on which branch?

@analogrelay
Copy link
Contributor

We still need to clear up the design for this. It would be on the release/2.2 branch. @BrennanConroy is investigating this now.

The likely design will be to flow a cancellation token for all invocations (regardless of InvokeAsync/SendAsync/StreamAsChannelAsync) and have it trigger CancelInvocationMessage on the client. Then update the server to flow a CancellationToken in to any hub method that requests one and trigger it when CancelInvocationMessage is signalled.

@JanEggers
Copy link

sounds good,

maybe this helps:

https://github.com/JanEggers/SignalR/commit/fb0b5a9faf8ba13f2cd3048093302a9398431857

cant run the tests because im missing the preview bits...

@analogrelay analogrelay added the PRI: 2 - Preferred Preferably should be handled during the milestone. label Aug 20, 2018
@BrennanConroy
Copy link
Member

6ba5e87

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cost: S Will take up to 2 days to complete PRI: 2 - Preferred Preferably should be handled during the milestone. status: Needs Design type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants