Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate NewClient, create Dial, NewLazyClient, and CheckHealth calls and support laziness #793

Closed
Tracked by #45
cretz opened this issue Apr 27, 2022 · 1 comment · Fixed by #795
Closed
Tracked by #45
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Apr 27, 2022

Is your feature request related to a problem? Please describe.

Today we have NewClient which, possibly unexpectedly to users, does more than create a client, it also connects to the server to confirm all connectivity. We previously had the ability to disable this but we removed that in #706.

Describe the solution you'd like

  • (re)Add client.Options.ConnectionOptions.DisableEagerConnection bool that defaults to false for NewClient
  • Add client.Dial call that force-sets client.Options.ConnectionOptions.DisableEagerConnection to false (so basically it's the same as NewClient today)
  • Add client.NewLazyClient call that force-sets client.Options.ConnectionOptions.DisableEagerConnection to true
  • Deprecate NewClient in favor of the Dial and NewLazyClient calls
  • Add a client ensureServerCapabilitiesFetched that atomically lazily obtains the server capabilities if not fetched already and are memoized on success
  • Update all client calls to have ensureServerCapabilitiesFetched call to support lazy connectivity
  • Add a CheckHealth call on the client that uses the gRPC health API (note, it too will lazily fetch capabilities)
@Spikhalskiy
Copy link
Contributor

This scope supersedes #753 and #595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants