Disconnect/close/cancel from the client side
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 802
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
Hi,
I can't find any method to disconnect the client as per my command. Using an example snippet here -
```
function doSomething () {
var SomeServiceClient = xxx.yyy_service.SomeServiceClient;
var client = new SomeServiceClient('http://localhost:8080', null, null);
status = client.testme(parameters, {},function (err, response) {
console.log('testme response: ' + response);
});
// how do i disconnect the client?
}
```
The problem I'm encountering is - user clicks a button, I make a request to the gRPC server and start receiving data in a stream. If the user clicks again, I start receiving data again in another stream. I want to disconnect any previous streams/connections so that I can receive only one stream at a time.
Any help/suggestions would be greatly appreciated!
(I know I could disable the click till the stream is finished, but that's not what I'm looking for.)
Contributor guide
Assessment
This issue has not been assessed yet.