Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncIO support for google-cloud-compute #1864

Open
satels opened this issue Jan 11, 2020 · 15 comments
Open

AsyncIO support for google-cloud-compute #1864

satels opened this issue Jan 11, 2020 · 15 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@satels
Copy link

satels commented Jan 11, 2020

I repeat old question: When are you start the supporting AsyncIO up?

The previous official request:
googleapis/google-cloud-python#3103

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 12, 2020
@mf2199 mf2199 added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jan 13, 2020
@zbarnett
Copy link

I am interested to know this as well.

@maxpz
Copy link

maxpz commented Mar 21, 2020

Really interested in this feature too. Are there some plans on when this is going to be worked on?

@plamut
Copy link
Contributor

plamut commented Mar 24, 2020

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.

@ghost
Copy link

ghost commented Apr 20, 2020

Its April. Where we at with this?

@ognacy
Copy link

ognacy commented Sep 5, 2020

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.

@ghost
Copy link

ghost commented Sep 6, 2020

Nice work @ognacy!
Do you have the code somewhere?

(Google are useless at writing APIs)

@robhaswell
Copy link

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.

@zagfai
Copy link

zagfai commented Sep 10, 2021

Waiting for aio support for spanner.. Few months passed.

@lyricnz
Copy link

lyricnz commented Jun 4, 2022

Also waiting for this. Frankly, it's a bit embarrassing not to have it already.

@zagfai
Copy link

zagfai commented Jun 5, 2022

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

@zagfai
Copy link

zagfai commented Jun 9, 2022

We make our lib which support asyncio for spanner open source: https://pypi.org/project/aspanner/

@parthea
Copy link
Contributor

parthea commented Oct 21, 2023

Closing as obsolete. The generated clients in this repository have AsyncIO support.

@parthea parthea closed this as completed Oct 21, 2023
@irfansharif
Copy link

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

@parthea
Copy link
Contributor

parthea commented Nov 16, 2023

@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 parthea reopened this Nov 16, 2023
@parthea parthea changed the title AsyncIO support AsyncIO support for google-cloud-compute Nov 16, 2023
@parthea parthea transferred this issue from googleapis/google-cloud-python Nov 16, 2023
@l1n
Copy link

l1n commented Mar 28, 2024

@parthea any update on this one? This would significantly speed up parallel use cases in Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests