Skip to content

Expose close() on clients#336

Open
ivanauth wants to merge 1 commit into
authzed:mainfrom
ivanauth:fix/issue-314-expose-client-close
Open

Expose close() on clients#336
ivanauth wants to merge 1 commit into
authzed:mainfrom
ivanauth:fix/issue-314-expose-client-close

Conversation

@ivanauth
Copy link
Copy Markdown
Contributor

@ivanauth ivanauth commented May 15, 2026

Adds close() to Client, SyncClient, and AsyncClient (for both v1 and materialize/v0) so applications can deterministically release the underlying gRPC channel during graceful shutdown, credential rotation, or stale-connection recovery, rather than relying on garbage collection.

Closes #314

Adds a public close() method to the v1 and materialize/v0 Client,
SyncClient, and AsyncClient classes. SyncClient.close() shuts the
underlying grpc.Channel synchronously; AsyncClient.close(grace=None)
is a coroutine that awaits grpc.aio.Channel.close(grace). The
auto-detecting Client returns whichever the active channel produces,
so callers can use the same shape in both modes.

Lets applications deterministically tear down connections during
graceful shutdown, credential rotation, or recovery from stale
connections, rather than relying on garbage collection.
@ivanauth ivanauth requested a review from a team as a code owner May 15, 2026 17:32
@ivanauth ivanauth changed the title Expose close() on Authzed clients Expose close() on clients May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose a way to close / recreate the underlying gRPC channel

1 participant