Skip to content

Commit 6e7a10b

Browse files
author
Ryan P
authored
Fix constructor doc (confluentinc#321) (confluentinc#397)
1 parent 03136d5 commit 6e7a10b

File tree

2 files changed

+36
-31
lines changed

2 files changed

+36
-31
lines changed

confluent_kafka/src/Consumer.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,25 +1411,28 @@ PyTypeObject ConsumerType = {
14111411
0, /*tp_as_buffer*/
14121412
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
14131413
Py_TPFLAGS_HAVE_GC, /*tp_flags*/
1414-
"High-level Kafka Consumer\n"
1415-
"\n"
1416-
".. py:function:: Consumer(**kwargs)\n"
1417-
"\n"
1418-
" Create new Consumer instance using provided configuration dict.\n"
1419-
"\n"
1420-
" Special configuration properties:\n"
1421-
" ``on_commit``: Optional callback will be called when a commit "
1422-
"request has succeeded or failed.\n"
1423-
"\n"
1424-
"\n"
1425-
".. py:function:: on_commit(err, partitions)\n"
1426-
"\n"
1427-
" :param Consumer consumer: Consumer instance.\n"
1428-
" :param KafkaError err: Commit error object, or None on success.\n"
1429-
" :param list(TopicPartition) partitions: List of partitions with "
1430-
"their committed offsets or per-partition errors.\n"
1431-
"\n"
1432-
"\n", /*tp_doc*/
1414+
"High-level Kafka Consumer\n"
1415+
"\n"
1416+
".. py:function:: Consumer(config)\n"
1417+
"\n"
1418+
" :param dict config: Configuration properties. At a minimum ``bootstrap.servers`` and "
1419+
"``group.id`` **should** be set"
1420+
"\n"
1421+
"Create new Consumer instance using provided configuration dict.\n"
1422+
"\n"
1423+
" Special configuration properties:\n"
1424+
" ``on_commit``: Optional callback will be called when a commit "
1425+
"request has succeeded or failed.\n"
1426+
"\n"
1427+
"\n"
1428+
".. py:function:: on_commit(err, partitions)\n"
1429+
"\n"
1430+
" :param Consumer consumer: Consumer instance.\n"
1431+
" :param KafkaError err: Commit error object, or None on success.\n"
1432+
" :param list(TopicPartition) partitions: List of partitions with "
1433+
"their committed offsets or per-partition errors.\n"
1434+
"\n"
1435+
"\n", /*tp_doc*/
14331436
(traverseproc)Consumer_traverse, /* tp_traverse */
14341437
(inquiry)Consumer_clear, /* tp_clear */
14351438
0, /* tp_richcompare */

confluent_kafka/src/Producer.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -633,18 +633,20 @@ PyTypeObject ProducerType = {
633633
0, /*tp_as_buffer*/
634634
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
635635
Py_TPFLAGS_HAVE_GC, /*tp_flags*/
636-
"Asynchronous Kafka Producer\n"
637-
"\n"
638-
".. py:function:: Producer(**kwargs)\n"
639-
"\n"
640-
" Create new Producer instance using provided configuration dict.\n"
641-
"\n"
642-
"\n"
643-
".. py:function:: len()\n"
644-
"\n"
645-
" :returns: Number of messages and Kafka protocol requests waiting to be delivered to broker.\n"
646-
" :rtype: int\n"
647-
"\n", /*tp_doc*/
636+
"Asynchronous Kafka Producer\n"
637+
"\n"
638+
".. py:function:: Producer(config)\n"
639+
"\n"
640+
" :param dict config: Configuration properties. At a minimum ``bootstrap.servers`` **should** be set\n"
641+
"\n"
642+
" Create new Producer instance using provided configuration dict.\n"
643+
"\n"
644+
"\n"
645+
".. py:function:: len()\n"
646+
"\n"
647+
" :returns: Number of messages and Kafka protocol requests waiting to be delivered to broker.\n"
648+
" :rtype: int\n"
649+
"\n", /*tp_doc*/
648650
(traverseproc)Producer_traverse, /* tp_traverse */
649651
(inquiry)Producer_clear, /* tp_clear */
650652
0, /* tp_richcompare */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy