diff options
author | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-16 13:52:28 -0800 |
---|---|---|
committer | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-16 13:52:28 -0800 |
commit | 94f4c9b3e6dc76111d21efa170a547378db0df38 (patch) | |
tree | 8e96535f18c130c49c5018cd6889e6ac37a256fe /kafka/conn.py | |
parent | 9644166048d6fe1cdbd1fc3096329ee2142b147e (diff) | |
download | kafka-python-94f4c9b3e6dc76111d21efa170a547378db0df38.tar.gz |
Make the default connection timeout None
This fixes the default behavior, which used to cause a socket timeout
when waiting for 10 seconds for a message to be produced.
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index a6d93f8..e4aec56 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -17,8 +17,13 @@ class KafkaConnection(local): by a call to `recv` in order to get the correct response. Eventually, we can do something in here to facilitate multiplexed requests/responses since the Kafka API includes a correlation id. + + host: the host name or IP address of a kafka broker + port: the port number the kafka broker is listening on + timeout: default None. The socket timeout for sending and receiving data. + None means no timeout, so a request can block forever. """ - def __init__(self, host, port, timeout=10): + def __init__(self, host, port, timeout=None): super(KafkaConnection, self).__init__() self.host = host self.port = port |