-
Notifications
You must be signed in to change notification settings - Fork 933
Make long waiting consumer and producer API wakeable #2126
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
base: master
Are you sure you want to change the base?
Changes from all commits
e064d90
ed2095d
cd44692
28ef10f
d7200d8
1e10109
ffb8c2e
447a6ce
49a6a6c
10cf864
ea444a3
5a86d02
5aca67c
2ff45b1
5be7933
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -105,6 +105,16 @@ static int Consumer_traverse(Handle *self, visitproc visit, void *arg) { | |||||
| } | ||||||
|
|
||||||
|
|
||||||
| /**************************************************************************** | ||||||
| * | ||||||
| * | ||||||
| * Consumer Methods | ||||||
| * | ||||||
| * | ||||||
| * | ||||||
| * | ||||||
| ****************************************************************************/ | ||||||
|
|
||||||
|
|
||||||
| static PyObject * | ||||||
| Consumer_subscribe(Handle *self, PyObject *args, PyObject *kwargs) { | ||||||
|
|
@@ -958,13 +968,36 @@ Consumer_offsets_for_times(Handle *self, PyObject *args, PyObject *kwargs) { | |||||
| #endif | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| /** | ||||||
| * @brief Poll for a single message from the subscribed topics. | ||||||
| * | ||||||
| * Instead of a single blocking call to rd_kafka_consumer_poll() with the | ||||||
| * full timeout, this function: | ||||||
| * 1. Splits the timeout into 200ms chunks | ||||||
|
||||||
| * 1. Splits the timeout into 200ms chunks | |
| * 1. Splits the timeout into 200ms chunks (CHUNK_TIMEOUT_MS = 200ms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always found C code less risky to refactor errors with single line if's include wrapping brackets, but I don't believe we follow that convention here as of now. If we're doing that convention within a function let's be consistent to the rest of the calls in the same scope imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to change but commenting that just enough code differences that it's probably best left separate even though it looks similar enough to share more code.
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace before closing comment marker.
| /* Create Python list from messages */ | |
| /* Create Python list from messages */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to have a giant comment block it maybe should be more descriptive. Though I'm not sure it's highly valuable here to do this anyway