Skip to content
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

Better support for monitoring DBus messages & example #92

Open
nogweii opened this issue Oct 16, 2021 · 1 comment
Open

Better support for monitoring DBus messages & example #92

nogweii opened this issue Oct 16, 2021 · 1 comment

Comments

@nogweii
Copy link

nogweii commented Oct 16, 2021

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.

  1. 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-monitor does.
  2. After calling BecomeMonitor, the socket becomes write-closed by the server. So the default behavior of #process no 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?

@daveola
Copy link

daveola commented May 15, 2024

100% this.

And unfortunately the example nogweii wrote no longer seems to work because the internal monkey patching has gone stale, as monkey patching will do:

undefined method `service' for #<MonitoringBus....> (NoMethodError)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants