Skip to content

Commit

Permalink
docs: add additional info on use_legacy_flow_control parameter (#301)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
plamut and anguillanneuf authored Apr 13, 2021
1 parent 9f451a1 commit f47523e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ class StreamingPullManager(object):
``projects/{project}/subscriptions/{subscription}``.
flow_control (~google.cloud.pubsub_v1.types.FlowControl): The flow
control settings.
use_legacy_flow_control (bool): Disables enforcing flow control settings
at the Cloud PubSub server and uses the less accurate method of only
enforcing flow control at the client side.
use_legacy_flow_control (bool):
If set to ``True``, flow control at the Cloud Pub/Sub server is disabled,
though client-side flow control is still enabled. If set to ``False``
(default), both server-side and client-side flow control are enabled.
scheduler (~google.cloud.pubsub_v1.scheduler.Scheduler): The scheduler
to use to process messages. If not provided, a thread pool-based
scheduler will be used.
Expand Down
8 changes: 6 additions & 2 deletions google/cloud/pubsub_v1/subscriber/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def subscribe(
a long time to process.
The ``use_legacy_flow_control`` argument disables enforcing flow control
settings at the Cloud PubSub server and uses the less accurate method of
only enforcing flow control at the client side.
settings at the Cloud Pub/Sub server, and only the client side flow control
will be enforced.
This method starts the receiver in the background and returns a
*Future* representing its execution. Waiting on the future (calling
Expand Down Expand Up @@ -200,6 +200,10 @@ def callback(message):
*scheduler* to use when executing the callback. This controls
how callbacks are executed concurrently. This object must not be shared
across multiple SubscriberClients.
use_legacy_flow_control (bool):
If set to ``True``, flow control at the Cloud Pub/Sub server is disabled,
though client-side flow control is still enabled. If set to ``False``
(default), both server-side and client-side flow control are enabled.
await_callbacks_on_shutdown (bool):
If ``True``, after canceling the returned future, the latter's
``result()`` method will block until the background stream and its
Expand Down

0 comments on commit f47523e

Please sign in to comment.