elixir-grpc / grpc

An Elixir implementation of gRPC
https://hex.pm/packages/grpc
Apache License 2.0
1.36k stars 210 forks source link

Add guide for Server and Client interceptors #342

Open Nezteb opened 7 months ago

Nezteb commented 7 months ago

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:

Describe alternatives you've considered

I can't think of any viable alternatives.

polvalente commented 7 months ago

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 commented 7 months ago

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

Nezteb commented 7 months ago

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

I agree; updating the docs is ideal!