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

Is there a async storage client, So async, wait can be used? #478

Open
Cedric-Chen opened this issue Jun 24, 2021 · 9 comments
Open

Is there a async storage client, So async, wait can be used? #478

Cedric-Chen opened this issue Jun 24, 2021 · 9 comments
Labels
api: storage Issues related to the googleapis/python-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@Cedric-Chen
Copy link

For google speech to text api, there are two types of client

  • speech.SpeechClient
  • speech.SpeechAsyncClient

But I couldn't find one AsyncClient for google storage service. Is there one official implementation?

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Jun 24, 2021
@danielduhh danielduhh added the type: question Request for information or clarification. Not an issue. label Jun 24, 2021
@danielduhh
Copy link

Hi @Cedric-Chen, we don't officially support asyncio in our python client. I'll mark this as a feature request and we'll consider it amongst exiting requests. Thanks!

@danielduhh danielduhh added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed type: question Request for information or clarification. Not an issue. labels Jun 24, 2021
@danielduhh
Copy link

cc: @Breathtender @andrewsg

@unforced
Copy link
Contributor

Hey @Cedric-Chen and anyone else curious about this.
We just removed support for Python2 from our client, and that move forward should be supportive for us integrating more async functionality in our official library, and that is something we will be exploring more in this year. Anything that does get put into the official library, we will try to make a note of here.

For now, while there isn't much official support included yet, it is possible to manually create async tasks in such a way that you can get some parallelization going with the storage library.
An example of that is included here:
https://github.com/googleapis/python-storage/blob/main/samples/snippets/storage_async_upload.py

If there are any questions please feel free to inquire and I can do my best to answer.

@raphaelauv
Copy link

In the example of @Breathtender things will run concurrently but not in parallel , cause upload_from_string is not async and you are not using a multiprocessing executor ( multithreading only run 1 thread at the same time with the python GIL ).

If upload_from_string was async then it will not make a blocking network system call and release his own execution to the loop with the keyword await, with that we would have 'optimal' concurrency

@adamserafini
Copy link

adamserafini commented Apr 5, 2022

Yep, I was excited for a moment, but the example isn't a case of 'true' asyncio unfortunately.

Is there any updated timeline for proper first class asyncio upload/download support in this library? 🙏

@zoidyzoidzoid
Copy link

This library seems to at least have some asyncio functionality on top of the gcloud library: https://github.com/talkiq/gcloud-aio

@praveen-elastic
Copy link

A few functions are skipped by gcloud-aio package mentioned here by @zoidbergwill . This repo provides the support for all the asyncio functionalities which can be achieved using json api. I hope you found it helpful.

@mattyoungberg
Copy link

Commenting in 2024, almost three years since this ticket has been opened... Any chance this feature request has made progress? It'd be great for this library to offer official asyncio support like many other official GCP Python clients do. Reading and writing chunks over a network to Cloud Storage is the exact kind of I/O-bound workload that asyncio excels at. That, and asyncio's uptake in the Python world is only increasing, not decreasing.

@LEAGUEDORA
Copy link

Hey Google Storage team, our whole architecture is on GCP. And we have an application where the code must be super async (No code must be sync), we are stuck with this package because there is no async support. And the Google-aio-storage thing takes 100ms time to download/upload. I am open to join as a beta user too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

9 participants