Skip to content

Commit 6d90fa7

Browse files
committed
Renamed producer delivery_callback to on_delivery
1 parent 4592b31 commit 6d90fa7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Producer.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static PyObject *Producer_produce (Producer *self, PyObject *args,
250250
"key",
251251
"partition",
252252
"callback",
253-
"delivery_callback", /* Alias */
253+
"on_delivery", /* Alias */
254254
"partitioner",
255255
NULL };
256256

@@ -365,16 +365,16 @@ static PyMethodDef Producer_methods[] = {
365365
"\n"
366366
" Produce message to topic.\n"
367367
" This is an asynchronous operation, an application may use the "
368-
"``ondelivery`` argument to pass a function (or lambda) that "
369-
"will be called from :py:func:`poll()` when the message has been "
370-
"succesfully delivered or permanently fails delivery.\n"
368+
"``callback`` (alias ``on_delivery``) argument to pass a function "
369+
"(or lambda) that will be called from :py:func:`poll()` when the "
370+
"message has been succesfully delivered or permanently fails delivery.\n"
371371
"\n"
372372
" :param str topic: Topic to produce message to\n"
373373
" :param str value: Message payload\n"
374374
" :param str key: Message key\n"
375375
" :param int partition: Partition to produce to, elses uses the "
376376
"configured partitioner.\n"
377-
" :param func ondelivery(err,msg): Delivery report callback to call "
377+
" :param func on_delivery(err,msg): Delivery report callback to call "
378378
"(from :py:func:`poll()` or :py:func:`flush()`) on succesful or "
379379
"failed delivery\n"
380380
"\n"
@@ -393,7 +393,7 @@ static PyMethodDef Producer_methods[] = {
393393
"\n"
394394
" Callbacks:\n"
395395
"\n"
396-
" - ``ondelivery`` callbacks from :py:func:`produce()`\n"
396+
" - ``on_delivery`` callbacks from :py:func:`produce()`\n"
397397
" - ...\n"
398398
"\n"
399399
" :param float timeout: Maximum time to block waiting for events.\n"

confluent_kafka.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ static int producer_conf_set_special (Producer *self, rd_kafka_conf_t *conf,
885885
PyObject *vs;
886886
const char *val;
887887

888-
if (!strcasecmp(name, "delivery_callback")) {
888+
if (!strcasecmp(name, "on_delivery")) {
889889
if (!PyCallable_Check(valobj)) {
890890
cfl_PyErr_Format(
891891
RD_KAFKA_RESP_ERR__INVALID_ARG,

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ The Python bindings also provide some additional configuration properties:
3535
* ``default.topic.config``: value is a dict of topic-level configuration
3636
properties that are applied to all used topics for the instance.
3737

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

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

0 commit comments

Comments
 (0)