Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit f47523e

Browse files
docs: add additional info on use_legacy_flow_control parameter (#301)
* docs: add more details on use_legacy_flow_control * asdsa * Update google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py * Update google/cloud/pubsub_v1/subscriber/client.py * Remove "less accurate" from flow control docs * Reword parameter description. Co-authored-by: Tianzi Cai <tianzi@google.com>
1 parent 9f451a1 commit f47523e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ class StreamingPullManager(object):
106106
``projects/{project}/subscriptions/{subscription}``.
107107
flow_control (~google.cloud.pubsub_v1.types.FlowControl): The flow
108108
control settings.
109-
use_legacy_flow_control (bool): Disables enforcing flow control settings
110-
at the Cloud PubSub server and uses the less accurate method of only
111-
enforcing flow control at the client side.
109+
use_legacy_flow_control (bool):
110+
If set to ``True``, flow control at the Cloud Pub/Sub server is disabled,
111+
though client-side flow control is still enabled. If set to ``False``
112+
(default), both server-side and client-side flow control are enabled.
112113
scheduler (~google.cloud.pubsub_v1.scheduler.Scheduler): The scheduler
113114
to use to process messages. If not provided, a thread pool-based
114115
scheduler will be used.

google/cloud/pubsub_v1/subscriber/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def subscribe(
146146
a long time to process.
147147
148148
The ``use_legacy_flow_control`` argument disables enforcing flow control
149-
settings at the Cloud PubSub server and uses the less accurate method of
150-
only enforcing flow control at the client side.
149+
settings at the Cloud Pub/Sub server, and only the client side flow control
150+
will be enforced.
151151
152152
This method starts the receiver in the background and returns a
153153
*Future* representing its execution. Waiting on the future (calling
@@ -200,6 +200,10 @@ def callback(message):
200200
*scheduler* to use when executing the callback. This controls
201201
how callbacks are executed concurrently. This object must not be shared
202202
across multiple SubscriberClients.
203+
use_legacy_flow_control (bool):
204+
If set to ``True``, flow control at the Cloud Pub/Sub server is disabled,
205+
though client-side flow control is still enabled. If set to ``False``
206+
(default), both server-side and client-side flow control are enabled.
203207
await_callbacks_on_shutdown (bool):
204208
If ``True``, after canceling the returned future, the latter's
205209
``result()`` method will block until the background stream and its

0 commit comments

Comments
 (0)