Declare which signals are subscribed to on DBus?
Question
Is there a way to declare which signals are subscribed by a Python application over DBus?
In other words, is there a way to advertise through the "Introspectable" interface which signals are subscribed to. I use "D-Feet D-Bus debugger".
E.g. Application subscribes to signal X (using the add_signal_receiver
method on a bus
object).
Solution
This is probably not possible since a signal is emitted on the bus and the application just picks out what is interesting. Subscribing is not happening inside dbus.
OTHER TIPS
D-Bus clients call AddMatch
on the bus daemon to register their interest in messages matching a particular pattern; most bindings add a match rule either for all signals on a particular service and object path, or for signals on a particular interface on that service and object path, when you create a proxy object.
Using dbus-monitor you can see match rules being added: try running dbus-monitor member=AddMatch
and then running an application that uses D-Bus. Similarly, you can eavesdrop calls to RemoveMatch
. However, there's currently no way to ask the daemon for the set of match rules currently in effect. Adding a way to ask that question would make more sense than adding a way for clients to re-advertise this, given that the daemon knows already.