What are the best practices for managing the lifecycle of ManagedChannel and client stub instances?
DI frameworks tend to favor long-lived singleton objects. What is the best practice for building gRPC clients with DI? 1. Inject a long-lived stub wrapping a long-lived ManagedChannel 2. Locally instantiate a short-lived stub wrapping an injected long-lived ManagedChannel 3. Create a fresh stub and ManagedChannel for each "unit of work" (multiple successive calls) 4. Create a fresh stub and ManagedChannel for each request -- 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/9f92811a-d913-4931-af95-c26a1c807513%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
