Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Renamed producer delivery_callback to on_delivery
  • Loading branch information
edenhill committed Apr 29, 2016
commit 6d90fa726a81f68d324d14da1f77103b46c51a05
12 changes: 6 additions & 6 deletions Producer.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static PyObject *Producer_produce (Producer *self, PyObject *args,
"key",
"partition",
"callback",
"delivery_callback", /* Alias */
"on_delivery", /* Alias */
"partitioner",
NULL };

Expand Down Expand Up @@ -365,16 +365,16 @@ static PyMethodDef Producer_methods[] = {
"\n"
" Produce message to topic.\n"
" This is an asynchronous operation, an application may use the "
"``ondelivery`` argument to pass a function (or lambda) that "
"will be called from :py:func:`poll()` when the message has been "
"succesfully delivered or permanently fails delivery.\n"
"``callback`` (alias ``on_delivery``) argument to pass a function "
"(or lambda) that will be called from :py:func:`poll()` when the "
"message has been succesfully delivered or permanently fails delivery.\n"
"\n"
" :param str topic: Topic to produce message to\n"
" :param str value: Message payload\n"
" :param str key: Message key\n"
" :param int partition: Partition to produce to, elses uses the "
"configured partitioner.\n"
" :param func ondelivery(err,msg): Delivery report callback to call "
" :param func on_delivery(err,msg): Delivery report callback to call "
"(from :py:func:`poll()` or :py:func:`flush()`) on succesful or "
"failed delivery\n"
"\n"
Expand All @@ -393,7 +393,7 @@ static PyMethodDef Producer_methods[] = {
"\n"
" Callbacks:\n"
"\n"
" - ``ondelivery`` callbacks from :py:func:`produce()`\n"
" - ``on_delivery`` callbacks from :py:func:`produce()`\n"
" - ...\n"
"\n"
" :param float timeout: Maximum time to block waiting for events.\n"
Expand Down
2 changes: 1 addition & 1 deletion confluent_kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ static int producer_conf_set_special (Producer *self, rd_kafka_conf_t *conf,
PyObject *vs;
const char *val;

if (!strcasecmp(name, "delivery_callback")) {
if (!strcasecmp(name, "on_delivery")) {
if (!PyCallable_Check(valobj)) {
cfl_PyErr_Format(
RD_KAFKA_RESP_ERR__INVALID_ARG,
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ The Python bindings also provide some additional configuration properties:
* ``default.topic.config``: value is a dict of topic-level configuration
properties that are applied to all used topics for the instance.

* ``delivery_callback`` (**Producer**): value is a Python function reference
* ``on_delivery`` (**Producer**): value is a Python function reference
that is called once for each produced message to indicate the final
delivery result (success or failure).
This property may also be set per-message by passing ``callback=somefunc``
to the confluent_kafka.Producer.produce() function.
This property may also be set per-message by passing ``callback=callable``
(or ``on_delivery=callable``) to the confluent_kafka.Producer.produce() function.

* ``on_commit`` (**Consumer**): Callback used to indicate success or failure
of commit requests.
Expand Down