d5h-foss / grpc-interceptor

Simplified Python gRPC interceptors
MIT License
136 stars 21 forks source link

Client Aio Support #29

Open erichulburd opened 1 year ago

erichulburd commented 1 year ago

First, just want to say this library has been a great way to get started and manage Python gRPC interceptors. Thanks for your contributions.

I've seen that server aio interceptor support was added as an outcome of https://github.com/d5h-foss/grpc-interceptor/issues/8, but it seems that this library still lacks support for grpc.aio._interceptor.ClientInterceptor.

I'm wondering if there was a particular challenge to implementing aio support on the client side? Or was it for lack of immediate interest? If so, how large of a lift would it be to get support for grpc.aio._intercept.ClientInterceptors?

d5h commented 1 year ago

Hi @erichulburd,

When I started this library it was to fulfill a need at work. We don’t do any async grpc where I work, which is the main reason haven’t implemented it yet. I actually have very limited experience with asyncio especially in grpc land, so am going to look to a volunteer contributor to add async client interceptors. Of course I’m happy to help get a PR merged.

If you’re interested in taking a shot at it then that’s great. Off the top of my head, the only real challenge I see is test reusability (which isn’t strictly a requirement but would be very nice to have). I was able to mostly reuse tests between the sync and async server interceptors. I’m not sure if this will be possible on the client side.

Other than that, I’d like to keep the API as similar as possible between sync and async, and also avoid adding new dependencies. Both those seem straightforward in this case.

erichulburd commented 1 year ago

OK great, that's useful info. I'm going to take a stab at an implementation for a present use-case I have, and if it goes well, I'll see about upstreaming it.

ChaserZ98 commented 2 months ago

There is a pending PR #50 related to this issue. Any chance of merging it?