grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Add guide for Server and Client interceptors

Open Nezteb opened this issue 2 years ago • 3 comments

Describe the solution you'd like

We currently support server interceptors via the GRPC.Endpoint module.

However, there seems to be no way to implement client interceptors.

Some relevant links:

  • https://learn.microsoft.com/en-us/aspnet/core/grpc/interceptors
  • https://edgehog.blog/a-guide-to-grpc-and-interceptors-265c306d3773

Describe alternatives you've considered

I can't think of any viable alternatives.

Nezteb avatar Dec 08 '23 02:12 Nezteb

https://github.com/elixir-grpc/grpc/blob/ab18c938ba9961002ad23d760f284836caf17a81/test/grpc/integration/client_interceptor_test.exs#L61

The feature is there already! I'll change the issue to improve documentation on this. We should probably add a guide with interceptors on both ends.

polvalente avatar Dec 08 '23 02:12 polvalente

Noting that this is lacking actual documentation. The Client Interceptor module points to Stub, but Stub just cites the option without explanation: https://hexdocs.pm/grpc/GRPC.Stub.html#connect/2

polvalente avatar Dec 08 '23 02:12 polvalente

I just came back here to mention that I eventually found the same module(s) you mentioned. 😅

I agree; updating the docs is ideal!

Nezteb avatar Dec 08 '23 02:12 Nezteb