| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Also note general best practice for multiprocessing use. Closes #5685.
| share instances across threads. In multiprocessing scenarious, best | ||
| practice is to create client instances *after* | ||
| :class:`multiprocessing.Pool` or :class:`multiprocessing.Process` invokes | ||
| :func:`os.fork`. |
|
sure
…On Tue, Aug 14, 2018 at 1:04 PM Frank Natividad ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/storage/client.rst
<#5763 (comment)>
:
> @@ -23,6 +23,15 @@ Install the ``google-cloud-storage`` library using ``pip``:
Usage
-----
+.. note::
+
+ Becuase the :class:`~google.cloud.storage.client.Client` uses the
+ third-party :mod:`requests` library by default, it should be safe to
+ share instances across threads. In multiprocessing scenarious, best
+ practice is to create client instances *after*
+ :class:`multiprocessing.Pool` or :class:`multiprocessing.Process` invokes
+ :func:`os.fork`.
Can we update the wording to "is thread-safe" or is that too strong?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5763 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPUc2SuZZiCdZP-wSKdfDaZComMg-5sks5uQy1WgaJpZM4VyHbE>
.
|
Sorry, something went wrong.
|
I ran into this same question when trying to optimize some Flask code running on GCF/GAE. Is the library written in such a way where we can make a general statement for all the APIs? Or is it really different for each API? |
Sorry, something went wrong.
|
@kaliberto We have two basic groups of APIs: those which use gRPC as their basic transport, and those whic use requests/HTTP. The gRPC-based clients are threadsafe, but not fork-safe; the requests-based clients are as threadsafe as requests (i.e., no known issues). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
/cc @BrandonY
Also note general best practice for multiprocessing use.
Closes #5685.