Hi, I'm looking to use the interceptor functionality to abort or cleanly cancel RPCs based on some logic. Right now I'm happy to use the built in gRPC status codes as they suit my needs. I can see in C# how setting the status and returning a response prior to invoking the continuation would work, however I cannot see how to return a null / empty response as right now this will throw an exception when serializing.
I can see there has been some discussion for other languages on this topic here: 1. https://github.com/grpc/grpc/issues/12824 2. https://github.com/grpc/grpc/issues/12826 In Issue #12826 Mehrdad Afshari <https://github.com/grpc/grpc/issues/12826#issuecomment-341267501>said the following which is identical to my situation: There was at least one case where the user wants to return a result from an > interceptor, not the handler, and there was no generic way to figure out > what the type of the correct type to return from the handler was in the > interceptor to construct an empty object out of. That is the prime > motivator for moving this forward. > I haven't had much luck finding any discussion on this topic for the C# library. Is there any plans for similar support? A naive look at the code by me seems that the responseWithFlags <https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs#L73>variable could be null if the response is null, but I don't fully understand the implications of that. Thanks, Joseph. -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d038db60-3612-4ecf-9c8e-13473d2e9518%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
