Closed sruehl closed 1 year ago
I don't think that Stop is necessary, as stopping is possible by canceling the context given to NewClient (and this is already well-documented). Adding Stop does add a second way to stop the client loop, which might cause misunderstandings. Furthermore the codebase grows without adding new functionality or improving other properties. What are your reasons for adding Stop?
It is confusing to have a Start()
without a Stop()
. Other than that you would need to keep/store a pointer to the cancel function when it would be sufficient to call a function on the client itself. It is so to say just a convenience method to not having to store the function and being able to just Stop()
the client. Other than that you said "PR welcome" here https://github.com/philippseith/signalr/issues/80#issuecomment-958061026
This is a convenience function utilizing cancel function.
Solves https://github.com/philippseith/signalr/issues/80