-
Notifications
You must be signed in to change notification settings - Fork 259
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
Allow purging (Purge API) / don't leak on dropping producer #520
Conversation
Resolves fede1024#518 **What it does:** - Purges producer on drop - Updates bindgen script to more recent bindgen version - Sets the parameter that makes macro constants signed (because that's how they are generally used in librdkafka)
Could use a ci run as well 🙂 |
This is ready. I went ahead and pulled the trigger on removing the It seems similarly unnecessary on the |
Since you suggested that I dedicate time to implementing this... when could I hope for this to be reviewed? |
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'm afraid I only have an hour or two every few months to spend on rust-rdkafka these days.
This looks pretty solid. Thanks again for sending it up. Just one comment about the use of bitflags
.
--raw-line "use num_enum::TryFromPrimitive;" \ | ||
--default-macro-constant-type "signed" \ |
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.
Was this important for this PR? Or just avoiding an as i32
somewhere?
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.
It was avoiding as i32
in my code as well as in existing code. Overall this seems to be how macro constants are used in librdkafka, so that seems to be the right way to represent these.
/// Don't wait for background thread queue purging to finish. | ||
const NON_BLOCKING = rdkafka_sys::RD_KAFKA_PURGE_F_NON_BLOCKING; | ||
} | ||
} |
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 feel like it would be Rust-ier to use a PurgeConfig
struct here with queue(bool)
, in_flight(bool)
, and non_blocking(bool)
methods. No particular need to save the two bytes. Also avoids the dependency on the bitflags
crate, which idk someone will probably care about. (We get a lot of PRs to minimize crate dependencies.)
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.
So that is something I initially considered and I changed my mind twice about it.
And here is one more ^^
Done in 37e3180
@Ten0 we're preparing a release of |
Conflicts: changelog.md
done |
Resolves #518
What it does:
Todo: