[serve] Deprecate client-based API in favor of process-wide singleton #14696
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Deprecates the
Client
-based API in favor of directly calling API calls likeserve.create_backend()
. We made an overcorrection here from the previous API that made things just more verbose/annoying. This change is a good middle ground: users can start temporary clusters attached to the lifetime of their session by callingserve.start()
in the code. Otherwise, they can start a long-lived session withserve.start(detached=True)
. API calls if neither of these are made implicitly callserve.connect()
to connect to a long-lived session.This PR still supports the old API but prints a warning message telling people to change their usage. The nice thing here is all they should need to do is
s/client\./serve./g
.Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.