Integration with a libevent loop

61 views
Skip to first unread message

yves baumes

unread,
Oct 19, 2021, 4:39:05 AM10/19/21
to Dbus-cxx
Hello,

How does dbus-cxx integrates with a poll/epoll event loop. More precisely with a libevent loop. I have multiple file descriptor to wait on, and I must avoid to spawn a new thread. How can I use dbus-cxx with my libevent loop?

Do you have any example? Or some code to look at?

Regards,
Yves

Robert Middleton

unread,
Oct 19, 2021, 8:09:31 AM10/19/21
to yves baumes, Dbus-cxx
This is easy to accomplish. See the documentation for dispatching:
https://dbus-cxx.github.io/dispatching.html

Basically, create a class that extends DBus::Dispatcher that
integrates with libevent. You can see an example using glib here:
https://github.com/dbus-cxx/dbus-cxx/blob/master/dbus-cxx-glib/glibdispatcher.cpp

-Robert Middleton
> --
> You received this message because you are subscribed to the Google Groups "Dbus-cxx" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dbus-cxx+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dbus-cxx/de37b091-32f4-4629-a607-61dbe057827dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages