-
Notifications
You must be signed in to change notification settings - Fork 287
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
Event interface #273
Comments
Hello! I haven't worked on the library for a while (@benesch has been doing all the work for the one 1+ years!), but I remember that moving to the event-based librdkafka interface was one of the goals I had in mind and I was actively experimenting on ~2 years ago, so I'd definitely be interested in the change you're proposing. I can't think of any downside, but again, my mental model of the library is a bit stale. I imagine that the rust-rdkafka public interface would remain the same? I leave it to @benesch to comment whether he'd have time to review this change or not, since it's probably going to be a significant amount of work. |
Apologies for the delayed response—things have been busy at work lately! I can't promise that I'll have time to review any large changes in the short term, but hopefully in the medium-to-long term. I'm definitely interested in anything that can either simplify the implementation of rust-rdkafka or improve its performance. That said, I'm not too familiar with librdkafka's event API. To make sure we're on the same page: you're talking about So, would definitely be interested to hear more about your approach! I think no matter what we'll want to retain the polling in the |
Completely understandable, I know the feeling :)
Well librdkafka's documentation is less clear/elloquent about the event interface, it took me some headscratching & hokuspokus to grok it...
I'm using the I've modified the Another thing about this approach is that basically I don't need the Context types, my I'll try to share the code somewhere for peeking. Perhaps I could somehow divide the changes into smaller chunks so that they could be easier to review... |
No kidding. It's hardly mentioned in issue reports or the wiki either. I think the best path forward here would be to introduce your consumer as a new consumer type alongside your new producer. ( |
@vojtechkral I'd be very interested to see what you have. Can you make it available somewhere? |
Hi,
we're using rust-rdkafka at @braiins . However, we found out that we probably wouldn't like to use the interface as is because of the requirement to spin up threads per stream and/or polling. We decided to fork it internally and switch to the event interface of librdkafka, which seems to be pretty efficient and goes quite well with the Rust's Futures model. At least a lot better compared to the callback interface, which is kind of hard to hook up with Futures/Streams without additional threads and/or long polling. I have written support for the evented interface in rust-rdkafka for our internal fork and after that we observed a multiple-times improvement in performance.
I noticed there is some work being done to get rid of the threads, however, I didn't study it in detail and if I'm looking right the evented interface is not being used...
I wanted to ask:
Thank you and thanks for making rust-rdkafka,
Vojtech
The text was updated successfully, but these errors were encountered: