Re the pattern, the basic idea adopted here, as in Go and C#, is to be able to add hooks to intercept all invocations before reaching the RPC core. To intercept "events", the interceptor would optionally decorate the return value from itself, to be able to inject code during the control-flow. I am considering adding a canonical interceptor that intercepts all RPC types and directly exposes higher-level hooks for such events, though I am not sure it should be part of the core PR, as it will effectively be an application of this interceptor API.
With respect to the naming, I followed the RPC handler object types in the language. In python, they are UnaryUnary, UnaryStream, StreamUnary, and StreamStream. On Fri, Oct 6, 2017 at 5:14 PM, dduke via grpc.io <[email protected]> wrote: > Glad to see a Python interceptor proposal! > > It seems to follow the pattern used in grpc-go, with APIs for RPC types > (unary_unary, unary_stream, etc) rather than APIs for phases of the > request/response (sendMessage, close, etc) like grpc-java. Can you describe > the overall strategy for interceptor APIs in the supported languages? > > I'm also curious about the names of the 4 RPC types. I'm familiar with > these names from the Node implementation: > Unary > ClientStreaming > ServerStreaming > Bidirectional > And from searching the grpc/grpc codebase I see those names in other > implementations. Is there an interest in standardizing the names of RPC > types across languages? > > On Monday, October 2, 2017 at 5:07:11 AM UTC-7, Mehrdad Afshari wrote: >> >> I've submitted a gRFC for supporting client and server interceptors in >> Python: >> >> https://github.com/grpc/proposal/pull/39 >> >> Implementation: https://github.com/grpc/grpc/pull/12778 >> >> Feedback is appreciated. Per the gRFC process, please keep discussion in >> this thread. >> >> -- > 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/546d9ea4-239a-4c6c-bb03-81ccd55cf32c%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/546d9ea4-239a-4c6c-bb03-81ccd55cf32c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CABdARdD8KWj3ypCu1OTCmEXBFNxLgohTizUkC5XfRt3GUEk6_A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
