gRPC Node.js server-side cancel

23 views
Skip to first unread message

ikcge...@gmail.com

unread,
Jul 17, 2019, 5:38:03 PM7/17/19
to grpc.io
Hey gRPC team, my name's Ian! Super excited about this technology, but have been running into a few difficulties implementing in Node.js. Here's one that has been stumping me:

I have a server-side streaming service-method on the client.


const numberStream = stub.streamNumbers(
 
{ number: 5 },
  meta
,
 
{
    interceptors
: [interceptorProvider]
 
},
 
{}
);



When I cancel the method from the client with...

numberStream.cancel()



My client side interceptor detects a cancelled event. But my server remains unaware of the cancellation.

The cancelled property remains "false", and my event listener for
call.on("cancelled",()=>{


})


does not fire. Any chance someone might know where my problem lies?

(snippet from server side streaming service method)

function streamNumbers(call) {


  call
.on("cancelled", () => {
    console
.log("cancelled");
    call
.end();
 
});


  console
.log(call.__proto__.__proto__);


}

Thomas Mercier

unread,
Jul 17, 2019, 6:51:29 PM7/17/19
to grpc.io
Not sure if this is your issue, but I am convinced the IsCancelled feature is broken in core: https://github.com/grpc/grpc/issues/18929
Reply all
Reply to author
Forward
0 new messages