-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
librdkafka and kevent/epoll. #617
Comments
Yes, this sounds really interesting. |
You could modify rd_kafka_q_t to trigger a kevent/epoll event as it calls cnd_signal() to wake up any listening threads. As a proof of concept try something like this:
|
@ah- Since librdkafka is multi-threaded internally it dont think there is any real use of plugging it into an existing dispatcher. I do have plans on rewriting some of the internal IO and thread handling though to improve producer latency. |
You could use the new rd_kafka_queue_io_event_enable() API, see here: |
Hi, thank you very much for this feature. I don't see a way to use it from within the C++ API. Am I missing something, is this intentional, or is it not yet implemented? |
It isn't implemented but it is trivial to implement io_event_enable() on the Queue class. |
I am working on a single threaded but performance oriented kevent based code. Process runs in a while loop calling kevent and relying on kevent to provide event (timer or file descriptor) which will then be passed to appropriate event handler.
Now librdkafka has its own mechanism to handle events and we need to call rd_kafka_consume() with a timeout. So practically I can call rd_kafka_consume in a timer. But as messages must be consumed within few mili seconds, keeping a timer of mili-second will cause high cpu.
Is there any way I can integrate librdkafka events to kevents based on some fd?
The text was updated successfully, but these errors were encountered: