From 32fbbb4e85a183130a59786d54019e047d68c202 Mon Sep 17 00:00:00 2001 From: Prad Nelluru Date: Fri, 25 Feb 2022 17:12:33 -0500 Subject: [PATCH] Reword some comments with "exactly-once delivery" --- google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | 4 ++-- .../pubsub_v1/subscriber/_protocol/streaming_pull_manager.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py b/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py index 979ddffe4..4bbedb2de 100644 --- a/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py +++ b/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py @@ -70,11 +70,11 @@ _MIN_EXACTLY_ONCE_DELIVERY_ACK_MODACK_RETRY_DURATION_SECS = 1 """The time to wait for the first retry of failed acks and modacks when exactly-once -is enabled.""" +delivery is enabled.""" _MAX_EXACTLY_ONCE_DELIVERY_ACK_MODACK_RETRY_DURATION_SECS = 10 * 60 """The maximum amount of time in seconds to retry failed acks and modacks when -exactly-once is enabled.""" +exactly-once delivery is enabled.""" class Dispatcher(object): diff --git a/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py b/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py index b44b7f39f..96ee1a0a1 100644 --- a/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py +++ b/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py @@ -385,7 +385,8 @@ def _obtain_ack_deadline(self, maybe_update: bool) -> float: ) self._ack_deadline = max(self._ack_deadline, flow_control_setting) elif self._exactly_once_enabled: - # Higher minimum ack_deadline for exactly_once subscriptions. + # Higher minimum ack_deadline for subscriptions with + # exactly-once delivery enabled. self._ack_deadline = max( self._ack_deadline, _MIN_ACK_DEADLINE_SECS_WHEN_EXACTLY_ONCE_ENABLED ) @@ -652,7 +653,7 @@ def heartbeat(self) -> bool: """Sends a heartbeat request over the streaming pull RPC. The request is empty by default, but may contain the current ack_deadline - if the exactly_once flag has changed. + if the self._exactly_once_enabled flag has changed. Returns: If a heartbeat request has actually been sent.