I'd generally recommend against trying to do that, simply because it would only work in a very limited set of situations. Also, using a middleware doesn't actually gain you anything since the logic is probably method-specific. Middleware is good for cross-cutting features that are mostly independent of method being called. Converting between API versions is rarely generic.
It'd also have trouble with the (static) types used with the generated code. On Tue, Apr 18, 2017 at 10:00 PM, Sahil Kharb <[email protected]> wrote: > How about using implementing service interceptors which will act as > middlewares and these middlewares will perform the additional work and then > forward the message to v1 method. > Any concerns around this? > > On Wednesday, April 19, 2017 at 12:21:21 AM UTC+5:30, Sahil Kharb wrote: >> >> Hello all, >> >> What kind of approach is suggested if we are creating v2 version for >> existing methods ? >> >> So, whenever we create the v2 endpoints, the chances of code duplication >> is very high, has anyone come up with any clean approach ?? >> >> Open for all kinds of suggestion. >> > -- > 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/ae2a4de5-5407-460e-bc44-da7a972ac29a%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/ae2a4de5-5407-460e-bc44-da7a972ac29a%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/CA%2B4M1oOEnYr-b_qxB2x5ki8ZX6edt19TVh3fO2enX2pGVZyu_w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
smime.p7s
Description: S/MIME Cryptographic Signature
