Some relevant conversation here https://groups.google.com/d/ msgid/grpc-io/14013c59-dc14-48d7-8521-8915c32820a9%40googlegroups.com <https://groups.google.com/d/msgid/grpc-io/14013c59-dc14-48d7-8521-8915c32820a9%40googlegroups.com?utm_medium=email&utm_source=footer>
On Tue, Sep 12, 2017 at 2:16 AM, Ryan Michela <[email protected]> wrote: > 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 > <https://groups.google.com/d/msgid/grpc-io/9f92811a-d913-4931-af95-c26a1c807513%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/CAFfmCFE9w6Wn4smqtpCOA6hqN9%3DZ_j8%3DoMTk4kS%3DR4JHC6YvVA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
