Open satels opened 4 years ago
I am interested to know this as well.
Really interested in this feature too. Are there some plans on when this is going to be worked on?
Unofficial answer - this will not be added until Python 2.7 support is dropped, which will only start happening in the client libraries after the last official Python 2.7.x release (scheduled for April 2020).
After that, the work on AsyncIO support might start, but not necessarily immediately after dropping Python 2.7. The pace will likely differ across various client libraries.
Side note - this issue is in the old monolithic repository, and progress of each individual client library should be tracked in their respective standalone repositories. The links to the new repositories are in the main README file.
Its April. Where we at with this?
Any updates on official support for asyncio?
I have ended up re-writing most of my google client code to using REST APIs with aiohttp considering the official client sdk lacks support for it, and some critical components of it lack things like timeout control.
Nice work @ognacy!
Do you have the code somewhere?
(Google are useless at writing APIs)
Any updates?
I have to say, the poor progress of Python client libraries is really making me question using Google Cloud for future projects. AWS has had asyncio support for years.
Waiting for aio support for spanner.. Few months passed.
Also waiting for this. Frankly, it's a bit embarrassing not to have it already.
@lyricnz I noticed that the spanner lib has provided low layer asyncio services client, so I implemented and tested an easy wrapped for asyncio, but it is the code for my company so I could not open source before permission. You could use the low layer services like this to do async rpc request:
from google.cloud import spanner_v1
_client = spanner_v1.services.spanner.SpannerAsyncClient()
name_project = f'projects/{project}'
name_instance = f'{name_project}/instances/{instance}'
name_database = f'{name_instance}/databases/{database}'
session = await _client.create_session(database=name_database)
request = spanner_v1.ReadRequest(
session=session.name,
table="tb_test_types",
columns=['id', 'data_num'],
key_set=spanner_v1.keyset.KeySet(all_=True)._to_pb()
)
response = await _client.read(request=request)
print(type(response))
print(response)
To wrap the lower layer, you need to implement session pool and management, transaction management, and AsyncStreamedResultSet.
We make our lib which support asyncio for spanner open source: https://pypi.org/project/aspanner/
Closing as obsolete. The generated clients in this repository have AsyncIO support.
@parthea, noob question, is there a generated client with AsyncIO support for https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-compute/google/cloud/compute_v1/services/instances? I was unable to find it.
@irfansharif You're right. There is no AsyncIO support for google-cloud-compute
. I'm going to transfer this feature request to the repository for the code generator that we use to generate the google-cloud-compute
library as I believe the feature needs to be added there.
@parthea any update on this one? This would significantly speed up parallel use cases in Python.
I repeat old question: When are you start the supporting AsyncIO up?
The previous official request: https://github.com/googleapis/google-cloud-python/issues/3103