Open Cedric-Chen opened 3 years ago
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!
cc: @Breathtender @andrewsg
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.
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
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? 🙏
This library seems to at least have some asyncio functionality on top of the gcloud library: https://github.com/talkiq/gcloud-aio
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.
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!
For google speech to text api, there are two types of client
But I couldn't find one
AsyncClient
for google storage service. Is there one official implementation?