diff options
author | Dana Powers <dana.powers@gmail.com> | 2015-01-23 09:41:03 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2015-01-23 09:41:03 -0800 |
commit | 587206ff6ad59ae01248d24ff9c9fadbdfc1c1fc (patch) | |
tree | a2d6f02a0c79ab3774527df39faf21deb4632936 /kafka/conn.py | |
parent | e6b37c00c5b0a52f821b35a4e26c0943f3e05b07 (diff) | |
parent | 01f378328e5383d05d52428b815f992eb2c536cb (diff) | |
download | kafka-python-587206ff6ad59ae01248d24ff9c9fadbdfc1c1fc.tar.gz |
Merge pull request #282 from wedaly/sphinx-api-docs
Add Sphinx API docs
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index ddfee8b..30debec 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -47,10 +47,11 @@ class KafkaConnection(local): 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 120. The socket timeout for sending and receiving data - in seconds. None means no timeout, so a request can block forever. + Arguments: + host: the host name or IP address of a kafka broker + port: the port number the kafka broker is listening on + 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=DEFAULT_SOCKET_TIMEOUT_SECONDS): super(KafkaConnection, self).__init__() @@ -116,8 +117,10 @@ class KafkaConnection(local): def send(self, request_id, payload): """ Send a request to Kafka - param: request_id -- can be any int (used only for debug logging...) - param: payload -- an encoded kafka packet (see KafkaProtocol) + + Arguments:: + request_id (int): can be any int (used only for debug logging...) + payload: an encoded kafka packet (see KafkaProtocol) """ log.debug("About to send %d bytes to Kafka, request %d" % (len(payload), request_id)) @@ -135,8 +138,12 @@ class KafkaConnection(local): def recv(self, request_id): """ Get a response packet from Kafka - param: request_id -- can be any int (only used for debug logging...) - returns encoded kafka packet response from server as type str + + Arguments: + request_id: can be any int (only used for debug logging...) + + Returns: + str: Encoded kafka packet response from server """ log.debug("Reading response %d from Kafka" % request_id) |