Closed rathsai closed 2 weeks ago
The missing method type is a good point. That should be added. Until that happens, you can use method_descriptor.requestStream
and method_descriptor.responseStream
in combination to determine the method type.
I don't believe an undefined
return type is necessary for the InterceptorProvider
type. In a situation where you don't need an interceptor that does anything, you can just return an interceptor that passes through the call unchanged:
function passthroughInterceptor(options, nextCall) {
return nextCall(options);
}
Is your feature request related to a problem? Please describe.
Hi, I have implemented a retry interceptor as per documentation https://github.com/grpc/proposal/blob/master/L5-node-client-interceptors.md and wanted to use InterceptorProvider. However, when I try to use the example provided in the doc, it doesn't work and has import errors. Next, was also able to see that
method_descriptor.method_type
andMethodType.UNARY
is not present in the library as well.Describe the solution you'd like
(methodDefinition: ClientMethodDefinition<any, any>): Interceptor
to(methodDefinition: ClientMethodDefinition<any, any>): Interceptor | undefined
since it is a provider and can evaluate to a condition where interceptors shouldn't be added.