Re: [GIT PULL] kdbus for 4.1-rc1

Havoc Pennington
2015-04-15T17:42:21Z

On Wed, Apr 15, 2015 at 1:20 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> I read a bit of the documentation, but not enough. I really need to sit
> down and play with code. That's the way I learn and understand.
>

It might be useful for some of the current devs to post about the best
APIs to play with these days - my old libdbus is pretty painful,
compared to some of the newer stuff.

gdbus nicely shows a callback-based way to handle owning a service,
using a function like g_bus_own_name:

https://developer.gnome.org/gio/stable/gio-Owning-Bus-Names.html#g-bus-own-name

The callback-based approach means the library can handle
reconnection/restart on behalf of the app.

The flip side (the way you use rather than provide a service) looks similar:
https://developer.gnome.org/gio/stable/gio-Watching-Bus-Names.html#g-bus-watch-name

Here the library can deal with complexities of a service being
restarted, the app only has to write the callbacks so they can be
called more than once (with alternating appeared/vanished handlers).

You can see in those API docs more of the ordering guarantees, in this
case on callback invocation - less for apps to screw up.

Havoc