Thank you for this response Michael, this has been super helpful and we've
been able to fully implement interceptors now! I actually had another
question and was wondering if you might be able to provide a bit of
direction for me. Any thoughts would be awesome! Here's where we're at:
*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 you 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__);
}
On Mon, Jul 15, 2019 at 1:22 PM Michael Lumish <[email protected]> wrote:
> This is one area where our API documentation is not great.
> interceptorProvider is a function type, not an exported function. In the
> Client constructor options parameter, two of the available options are
> "interceptors" and "interceptor_providers", which take an array of
> Interceptors and an array of InterceptorProviders, respectively.
>
> On Sun, Jul 14, 2019 at 6:27 PM Ian Crena Geckeler <[email protected]>
> wrote:
>
>> Hello Google gRPC Team!
>>
>> My name's Ian, and I have a quick question about gRPC-Node.
>>
>> On the documentation, InterceptorProvider is listed as a global method
>> however, my team cannot find that method on the grpc object.
>>
>> Any insight into how to access this method, or how else we might define
>> interceptors and attach them to a service-method on the client/stub would
>> be super helpful. Thank you, and have a terrific week!
>>
>> Best,
>> Ian
>> --
>> Ian Geckeler
>> USC | Class of 2019
>> Computational Mathematics
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/grpc-io/CABO788vSEMfTKWMe6j76sj5jO_d7UR-xgfLX6PVapnn1-KNfgg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/grpc-io/CABO788vSEMfTKWMe6j76sj5jO_d7UR-xgfLX6PVapnn1-KNfgg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
Ian Geckeler
USC | Class of 2019
Computational Mathematics
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/CABO788tAxEYnw7B5eKXyPaJQbD3KaygHMtnNcS82cOiiWfp31g%40mail.gmail.com.