Skip to content

Fix constructor doc (#321) #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions confluent_kafka/src/Consumer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,25 +1411,28 @@ PyTypeObject ConsumerType = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"High-level Kafka Consumer\n"
"\n"
".. py:function:: Consumer(**kwargs)\n"
"\n"
" Create new Consumer instance using provided configuration dict.\n"
"\n"
" Special configuration properties:\n"
" ``on_commit``: Optional callback will be called when a commit "
"request has succeeded or failed.\n"
"\n"
"\n"
".. py:function:: on_commit(err, partitions)\n"
"\n"
" :param Consumer consumer: Consumer instance.\n"
" :param KafkaError err: Commit error object, or None on success.\n"
" :param list(TopicPartition) partitions: List of partitions with "
"their committed offsets or per-partition errors.\n"
"\n"
"\n", /*tp_doc*/
"High-level Kafka Consumer\n"
"\n"
".. py:function:: Consumer(config)\n"
"\n"
" :param dict config: Configuration properties. At a minimum ``bootstrap.servers`` and "
"``group.id`` **should** be set"
"\n"
"Create new Consumer instance using provided configuration dict.\n"
"\n"
" Special configuration properties:\n"
" ``on_commit``: Optional callback will be called when a commit "
"request has succeeded or failed.\n"
"\n"
"\n"
".. py:function:: on_commit(err, partitions)\n"
"\n"
" :param Consumer consumer: Consumer instance.\n"
" :param KafkaError err: Commit error object, or None on success.\n"
" :param list(TopicPartition) partitions: List of partitions with "
"their committed offsets or per-partition errors.\n"
"\n"
"\n", /*tp_doc*/
(traverseproc)Consumer_traverse, /* tp_traverse */
(inquiry)Consumer_clear, /* tp_clear */
0, /* tp_richcompare */
Expand Down
26 changes: 14 additions & 12 deletions confluent_kafka/src/Producer.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,18 +633,20 @@ PyTypeObject ProducerType = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Asynchronous Kafka Producer\n"
"\n"
".. py:function:: Producer(**kwargs)\n"
"\n"
" Create new Producer instance using provided configuration dict.\n"
"\n"
"\n"
".. py:function:: len()\n"
"\n"
" :returns: Number of messages and Kafka protocol requests waiting to be delivered to broker.\n"
" :rtype: int\n"
"\n", /*tp_doc*/
"Asynchronous Kafka Producer\n"
"\n"
".. py:function:: Producer(config)\n"
"\n"
" :param dict config: Configuration properties. At a minimum ``bootstrap.servers`` **should** be set\n"
"\n"
" Create new Producer instance using provided configuration dict.\n"
"\n"
"\n"
".. py:function:: len()\n"
"\n"
" :returns: Number of messages and Kafka protocol requests waiting to be delivered to broker.\n"
" :rtype: int\n"
"\n", /*tp_doc*/
(traverseproc)Producer_traverse, /* tp_traverse */
(inquiry)Producer_clear, /* tp_clear */
0, /* tp_richcompare */
Expand Down