summaryrefslogtreecommitdiff
path: root/kafka/coordinator/base.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2019-09-28 19:19:29 -0700
committerGitHub <noreply@github.com>2019-09-28 19:19:29 -0700
commit5d1d42429e07f4aa2959b488ea76efb6d0bafc79 (patch)
tree6a3b0701b6c80d11bec9d8277757dc589561fb6a /kafka/coordinator/base.py
parenta9f513cf9978b8b9f26ad04bba1d33a9ae6d1b99 (diff)
downloadkafka-python-5d1d42429e07f4aa2959b488ea76efb6d0bafc79.tar.gz
Wrap consumer.poll() for KafkaConsumer iteration (#1902)
Diffstat (limited to 'kafka/coordinator/base.py')
-rw-r--r--kafka/coordinator/base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/kafka/coordinator/base.py b/kafka/coordinator/base.py
index 421360e..5cdbdcf 100644
--- a/kafka/coordinator/base.py
+++ b/kafka/coordinator/base.py
@@ -321,10 +321,14 @@ class BaseCoordinator(object):
self.heartbeat.poll()
def time_to_next_heartbeat(self):
+ """Returns seconds (float) remaining before next heartbeat should be sent
+
+ Note: Returns infinite if group is not joined
+ """
with self._lock:
# if we have not joined the group, we don't need to send heartbeats
if self.state is MemberState.UNJOINED:
- return sys.maxsize
+ return float('inf')
return self.heartbeat.time_to_next_heartbeat()
def _handle_join_success(self, member_assignment_bytes):