I have a gRPC server that streams data for an indefinite amount of time. It spawns a child process that retrieves some hardware resources stats.
What I want is to cancel the gRPC call from the client so that I can kill the spawned process. Another solution would be a way to detect on the server when the client disconnects so that I can kill the process.
I am using grpc-node for both the client and the server.
I can't seem to figure out how to do this yet...
Found the answer here: https://grpc.github.io/grpc/node/grpc-ClientReadableStream.html Apparently I was using .close instead of .cancel
On Server
On Client