feat: add asyncio client in orbita.aio - #1
Open
bradhe wants to merge 1 commit into
Open
Conversation
Mirror the synchronous API method-for-method on grpc.aio, sharing the result dataclasses, validation helpers, and error types so an application can move between the two without translating anything. The transport grows an aio channel opener and an asyncio retry loop with the same read-only-retry and ambiguous-mutation posture. The one structural difference is connection setup: __init__ cannot await, so the data client records configuration and performs the limits handshake in connect(), with async-with connecting on entry. Admin has no handshake, so its channel still opens eagerly. Unit tests reuse the in-process sync gRPC server through pytest-asyncio, and the integration suite gains an async pass verified against the pinned server image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the asyncio API in
orbita.aio, mirroring the synchronous client method-for-method ongrpc.aio.What
orbita.aio.Client/Keyspace:get,get_entry,set,delete,list_page,pages(async iterator),readinessorbita.aio.AdminClient: full Admin surfaceopen_aio_channelandretry_read_aiowith the same posture: retry only read-only calls onUNAVAILABLE, never retry mutations, raiseAmbiguousMutationErrorwhen the outcome is unknowableWhy the connection setup differs
__init__cannot await, so the async data client records configuration and performs the GetLimits handshake inconnect();async withconnects on entry. Calls before connecting raise a clearRuntimeError. Admin has no handshake, so its channel opens eagerly and only close is managed.Testing
ORBITA_REQUIRE_AUTH=true: 2 passedruff check,ruff format --check,mypy(strict),pytestall green