No way to advertise an interface?

Thomas Kluyver thomas at kluyver.me.uk
Wed Sep 29 09:18:14 UTC 2021


On Wed, 29 Sep 2021, at 09:43, Lawrence D'Oliveiro wrote:
> Or you could give up on looking for a specific bus name, instead scan
> all bus peers to find out which ones implement a specific interface.

You could, but each thing that does this would have to make a load of requests, and then (if you mean D-Bus introspection) parse XML replies. If you care about detecting newly started implementations as well, you've also got to watch for new connections and query them. It seems like a lot of overhead.

> Perhaps we need a pair of signals, “interface request” and “interface
> reply”. One peer can ask “does anybody implement interface X?” then
> listen for “I implement interface X” responses.

I thought of that as well - obviously you could implement it even without the signals being standardised. But it has a couple of downsides: you can only pick up currently running services (not activatable ones), and the client trying to build the list of implementations has to sit and wait for some arbitrary period of time, and then hope that it's got all the responses it's going to get.

If there's the will to standardise some way of advertising interfaces, I'd hope that we could work out something which didn't have those limitations. I would imagine that, like well-known names, there would be both a dynamic way (D-Bus messages) and a static one (files) to advertise support for an interface, and a central piece (either the message bus or something adjacent) that maintains a list of what is claiming to support what interface.

Thanks,
Thomas


More information about the dbus mailing list