Release the gRPC channel and any bearer-auth resources. Idempotent. If `from_active_cluster` wired up an OIDC refresher for this client, the refresher's underlying httpx.Client is closed here too — otherwise long-lived services that churn clients would leak sockets /
(self)
| 371 | ) |
| 372 | |
| 373 | def close(self) -> None: |
| 374 | """Release the gRPC channel and any bearer-auth resources. |
| 375 | |
| 376 | Idempotent. If `from_active_cluster` wired up an OIDC refresher |
| 377 | for this client, the refresher's underlying httpx.Client is |
| 378 | closed here too — otherwise long-lived services that churn |
| 379 | clients would leak sockets / file descriptors until GC. |
| 380 | """ |
| 381 | self._channel.close() |
| 382 | if self._bearer_close is not None: |
| 383 | with contextlib.suppress(Exception): |
| 384 | self._bearer_close() |
| 385 | self._bearer_close = None |
| 386 | |
| 387 | def __enter__(self) -> SandboxClient: |
| 388 | return self |
no outgoing calls