googleapis / googleapis/google-cloud-python

Provide a complete/high-level async client API

未关闭
#15,918 8 条评论 14 个 reaction 已指派 1 人 已被 @larkee 认领 在 GitHub 查看
api: spanner
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

**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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。