-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interceptor support #29
Comments
If you're willing to use some reflection, something like this should work: var def = Greeter.BindService(new GreeterService());
var def2 = def.Intercept(...); // Needs a Grpc.Core reference
def2.BindService(server.ServiceBinder); // BindService is internal to Grpc.Core.Api so you'll need reflection to do this call |
Sorry, just getting around to looking at this now. I now realize that the Intercept API requires Grpc.Core, which will be deprecated per https://grpc.io/blog/grpc-csharp-future/. Would it be possible to provide an Intercept API that doesn't require reflection or reference to Grpc.Core? Also, and somewhat related: Can you provide any advice on this package (GrpcNamedPipes) vs. https://docs.microsoft.com/en-us/aspnet/core/grpc/interprocess?view=aspnetcore-6.0 ? I love your library b/c it is easy to setup and use, but am wondering if it is better to go with something officially supported by the gRpc team. As always, thanks for your help - much appreciated! |
Thanks for the link, I didn't realize that had been implemented - Unix domain sockets should be comparable to named pipes, providing you're using Windows 10. This library will still have advantages in terms of being lightweight (and probably better performance but I'd need to test). But otherwise Kestrel would be a good solution, especially if you need features I haven't implemented. |
+1 |
Hello,
I have a .NET 5.0 app that uses gRpc and your package to perform IPC. I wish to add interceptors for global logging, error handling, and profiling. I attempted the solution in https://stackoverflow.com/questions/55630096/grcp-intercept-calls-in-c-sharp, but could not see a way to add the interceptor. That is b/c, per your README, the proper way to bind the service is via:
Greeter.BindService(server.ServiceBinder, new GreeterService());
Which (as best I can tell) does not provide access to the .Intercept API. Any suggestions?
Thanks!
The text was updated successfully, but these errors were encountered: