diff options
author | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-16 14:57:24 -0800 |
---|---|---|
committer | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-16 14:57:24 -0800 |
commit | ef24c117fee22d4f5ba9f71450974ddad598fafa (patch) | |
tree | 89d732e9cc023ee099b66841d72d37ea5559f7f2 /kafka/conn.py | |
parent | 94f4c9b3e6dc76111d21efa170a547378db0df38 (diff) | |
download | kafka-python-ef24c117fee22d4f5ba9f71450974ddad598fafa.tar.gz |
Change default socket timeout to 120 seconds in both the client and connection
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index e4aec56..2877c74 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -8,6 +8,7 @@ from kafka.common import ConnectionError log = logging.getLogger("kafka") +DEFAULT_SOCKET_TIMEOUT_SECONDS = 120 class KafkaConnection(local): """ @@ -20,10 +21,10 @@ class KafkaConnection(local): 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. + timeout: default 120. The socket timeout for sending and receiving data + in seconds. None means no timeout, so a request can block forever. """ - def __init__(self, host, port, timeout=None): + def __init__(self, host, port, timeout=DEFAULT_SOCKET_TIMEOUT_SECONDS): super(KafkaConnection, self).__init__() self.host = host self.port = port |