From f9d020fd815f10f43ce2b47d29cfb0a83b99ae5a Mon Sep 17 00:00:00 2001 From: HemangChothani Date: Thu, 11 Jun 2020 17:22:58 +0530 Subject: [PATCH 1/3] docs(bigquery): add client thread-safety documentation --- docs/index.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index ec360de69..8f8ce75a2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,14 @@ .. include:: README.rst +.. note:: + + Because the bigquery client uses the third-party :mod:`requests` library + by default and the bigquery-storage client uses :mod:`grpcio` library, + both are safe to share instances across threads. In multiprocessing + scenarios, best practice is to create client instances *after* + :class:`multiprocessing.Pool` or :class:`multiprocessing.Process` invokes + :func:`os.fork`. + More Examples ~~~~~~~~~~~~~ From b038585e0c89838d618b16b828b4b3cf442cf067 Mon Sep 17 00:00:00 2001 From: HemangChothani Date: Fri, 12 Jun 2020 12:55:07 +0530 Subject: [PATCH 2/3] docs(bigquery): nit --- docs/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 8f8ce75a2..9636171a0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,10 +2,10 @@ .. note:: - Because the bigquery client uses the third-party :mod:`requests` library - by default and the bigquery-storage client uses :mod:`grpcio` library, + Because the Bigquery client uses the third-party :mod:`requests` library + by default and the Bigquery-Storage client uses :mod:`grpcio` library, both are safe to share instances across threads. In multiprocessing - scenarios, best practice is to create client instances *after* + scenarios, the best practice is to create client instances *after* :class:`multiprocessing.Pool` or :class:`multiprocessing.Process` invokes :func:`os.fork`. From 6354f7bbc188f0ec78af7596d9c197bb88594003 Mon Sep 17 00:00:00 2001 From: HemangChothani Date: Fri, 12 Jun 2020 17:51:00 +0530 Subject: [PATCH 3/3] docs(bigquery): nit --- docs/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 9636171a0..62a82e0e9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,8 +2,8 @@ .. note:: - Because the Bigquery client uses the third-party :mod:`requests` library - by default and the Bigquery-Storage client uses :mod:`grpcio` library, + Because the BigQuery client uses the third-party :mod:`requests` library + by default and the BigQuery-Storage client uses :mod:`grpcio` library, both are safe to share instances across threads. In multiprocessing scenarios, the best practice is to create client instances *after* :class:`multiprocessing.Pool` or :class:`multiprocessing.Process` invokes