Skip to content

Commit 1266b3c

Browse files
committed
Added ThrottleEvent to docs
1 parent d613894 commit 1266b3c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

confluent_kafka/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
class ThrottleEvent (object):
2222
"""
2323
ThrottleEvent contains details about a throttled request.
24+
Set up a throttle callback by setting the ``throttle_cb`` configuration
25+
property to a callable that takes a ThrottleEvent object as its only argument.
26+
The callback will be triggered from poll(), consume() or flush() when a request
27+
has been throttled by the broker.
2428
2529
This class is typically not user instantiated.
2630
27-
:ivar broker_name str: The hostname of the broker which throttled the request
28-
:ivar broker_id int: The broker id
29-
:ivar throttle_time float: The amount of time (in seconds) the broker throttled (delayed) the request
31+
:ivar str broker_name: The hostname of the broker which throttled the request
32+
:ivar int broker_id: The broker id
33+
:ivar float throttle_time: The amount of time (in seconds) the broker throttled (delayed) the request
3034
"""
3135
def __init__(self, broker_name,
3236
broker_id,

confluent_kafka/src/confluent_kafka.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ static void throttle_cb (rd_kafka_t *rk, const char *broker_name, int32_t broker
11991199
int throttle_time_ms, void *opaque) {
12001200
Handle *h = opaque;
12011201
PyObject *ThrottleEvent_type, *throttle_event;
1202-
PyObject *result, *kwargs, *args;
1202+
PyObject *result, *args;
12031203
CallState *cs;
12041204

12051205
cs = CallState_get(h);

docs/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ Logical offset constants:
8484
* :py:const:`OFFSET_STORED` - Use stored/committed offset
8585
* :py:const:`OFFSET_INVALID` - Invalid/Default offset
8686

87+
*************
88+
ThrottleEvent
89+
*************
90+
91+
.. autoclass:: confluent_kafka.ThrottleEvent
92+
:members:
8793

8894

8995
Configuration

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