You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The high-level spanner.Client API is all blocking methods. To develop a FastAPI service using Spanner as a datastore it would be good to be able to take advantage of Python's async features and interact with Spanner in an asyncio context.
Describe the solution you'd like
Provide a spanner.AsyncClient class that mirrors the API of spanner.Client but with async methods that allow usage in an async context without having to block on IO calls.
Describe alternatives you've considered
There is a low-level AsyncSpannerClient class that wraps the underlying gRPC API, but making use of this requires re-implementing large parts of the existing spanner.Client API and then having to maintain that code separately to the python-spanner library - in particular needing to manage session pooling and ResultSet/PartialResultSet response types, which is frustrating when a lot of this functionality already exists in this library, but only behind a blocking API
Additional context
I'm happy to contribute this feature if it is accepted.
The text was updated successfully, but these errors were encountered:
This would be useful or at the least working samples on using the AsyncSpannerClient API. I've been trying to just get it functional but have been struggling, testing with the emulator.
Is your feature request related to a problem? Please describe.
The high-level
spanner.Client
API is all blocking methods. To develop a FastAPI service using Spanner as a datastore it would be good to be able to take advantage of Python's async features and interact with Spanner in an asyncio context.Describe the solution you'd like
Provide a
spanner.AsyncClient
class that mirrors the API ofspanner.Client
but withasync
methods that allow usage in an async context without having to block on IO calls.Describe alternatives you've considered
There is a low-level
AsyncSpannerClient
class that wraps the underlying gRPC API, but making use of this requires re-implementing large parts of the existingspanner.Client
API and then having to maintain that code separately to thepython-spanner
library - in particular needing to manage session pooling andResultSet
/PartialResultSet
response types, which is frustrating when a lot of this functionality already exists in this library, but only behind a blocking APIAdditional context
I'm happy to contribute this feature if it is accepted.
The text was updated successfully, but these errors were encountered: