ruby-dbus
ruby-dbus copied to clipboard
Better support for monitoring DBus messages & example
It would be nice to have better support for monitoring/eavesdropping on messages sent across the bus. I have made a functional example but it requires a bit of monkey patching to change the library's behavior. This is the same functionality provided by the dbus-monitor(1) command.
- Support for another flag in match rules, though I'm not 100% certain it's needed for new enough implementations. I'm doing this to behave the same way
dbus-monitordoes. - After calling BecomeMonitor, the socket becomes write-closed by the server. So the default behavior of
#processno longer applies.
I think this is a useful feature, so I'd like to see this upstreamed. Not certain on the exact design though. A special #become_monitor method on DBus::Connection that re-uses the registered @signal_matchrules?