Skip to content
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

Cancel a server-streaming request from grpc-call node #4

Open
AitorF opened this issue May 8, 2019 · 2 comments
Open

Cancel a server-streaming request from grpc-call node #4

AitorF opened this issue May 8, 2019 · 2 comments

Comments

@AitorF
Copy link

AitorF commented May 8, 2019

Hi!

I am trying to modify (I would make a pull-request afterward) the grpc-call to cancel a server-streaming request from client. The idea I am working on is to pass another input to the grpc-call node (kinf of msg.cancel = true), get this from node.on("input", function (msg) { method and cancel the ongoing request.

The problem is that I don't find a way to cancel it. I don't find any documentation nor any .cancel() method.

Any help?

@MrWhite80
Copy link

I added the following to support this concept. In the grpc-call.js in the node.on("input"...) at the top of the function, If the message topic is set to "close" then you can call the same code used in the on close for the node. using grpc.closeClient.

if(msg.topic == "close"){
if (node.client) {
grpc.closeClient(node.client)
delete node.client;
delete node.channel;
}
return;
}

@namgk
Copy link
Collaborator

namgk commented Mar 24, 2022

does it open automatically in future messages?

sorry it's been long time I haven't worked on these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants