Re: impending gdbus merge



Hey,

On Mon, May 10, 2010 at 11:09 AM, Mikkel Kamstrup Erlandsen
<mikkel kamstrup canonical com> wrote:
> I have two questions though. Firstly; why is there no API for installing
> and removing generic match rules? They seem like such a fundamental
> thing in DBus, and there alreay is API for installing filter funcs
> anyway. Of course I can just call the AddMatch method asynchronously
> myself, but having the convenience API like libdbus provides is mighty
> handy.

Hmm, g_dbus_connection_signal_subscribe() should do what you want. If
it doesn't.. well.. then you can always call AddMatch() yourself
(easily, via a single g_dbus_connection_call() function call) and
install a filter via g_dbus_connection_add_filter()... with all the
threading-issues that involve.

Anyway, the general thinking is that if you have the need to use
g_dbus_connection_add_filter() then 1. maybe there is room to simply
your D-Bus API; or 2. you have extremely special needs (e.g. you are
writing a binding) ...

(Related to this: the world would be a much better place if people
designed D-Bus APIs where all you needed was to watch a set of proxies
and their properties (via the org.fd.DBus.PropertiesChanged() signal)
and do very simple book-keeping like watching a /org/service/Manager
object and objects you discover via this object (e.g.
Manager.GetFrobs() method, Manager.FrobAdded(), Manager.FrobRemove()
signals. Of course the world is not always that simple and that's why
we have a mechanism like filter functions. But we certainly shouldn't
*optimize* our APIs for such situations, in fact, penalizing (e.g.
filter runs in separate thread) such situations like we do now is
probably the right answer...)

> Second thing - are there any plans for an IDL-like compiler like eggdbus
> currently ships? Implementing my DBus interfaces with compile-time type
> safety and with GInterfaces is a mighty nice thing.

There are plans, sure, but nothing concrete yet. And I don't expect
anything concrete to be part of GLib this or next release - I do think
that people should experiment with tools like this (e.g. eggdbus-idl
that I wrote or GObject Intropspection integration or whatever)
outside GLib where there are no ABI guarantees etc.

Cheers,
David


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]