Re: impending gdbus merge
- From: David Zeuthen <zeuthen gmail com>
- To: Christian Persch <chpe gnome org>
- Cc: gtk-devel-list gnome org
- Subject: Re: impending gdbus merge
- Date: Wed, 12 May 2010 13:22:34 -0400
Hey,
On Wed, May 12, 2010 at 9:51 AM, Christian Persch <chpe gnome org> wrote:
> Hi;
>
> I have just a few remarks/questions after having ported a couple of
> things to gdbus, and having looked at the API:
Cool, thanks for doing this!
> - g_bus_own_name has a _on_connection variant that directly takes a
> GDBusConnection*; maybe g_bus_watch_name and g_bus_watch_proxy
> shoule also have such a variant.
Sure, if it turns out we need such variants we can always add them
(IIRC, the reason I added g_bus_own_name_on_connection() was simply to
make writing test cases easier...)
> - timeouts in g_dbus_connection_call[_sync] etc are in ms and default
> to 30000 ms. Does it really matter if the timeout is exact here, or
> just 30s-ish ? I'd suggest to make these timeout parameters take
> seconds instead, and use the sloppy glib timeouts. (If there really is
> a use case for exact timeouts, maybe a call flag like
> G_DBUS_CALL_PRECISE_TIMEOUT could be added that makes these timeouts
> interpreted as ms and use precise glib timeouts.)
I don't think it matters much - I mean, timeouts are not common at all
so using sloopy timeouts is kinda like optimizing for the 0.1% case.
And since libdbus (and other bindings) already uses milliseconds I'd
like to keep it the same for compat reasons.
> - should g_bus_unwatch_name/proxy call the name/proxy_disappeared
> callbacks, if the name/proxy_appeared callbacks have been called
> before? It appears they don't. (I checked the watch_name one; I
> assume watch_proxy is the same?) It would be nice not to have to
> manually clean up after calling unwatch, when I also do the same in
> the disappeared-callback.
It actually used to be like that. This is why we changed it
Don't guarantee that on_name_lost() will be called after g_bus_unown()
This guarantee made it impossible to use g_bus_own_name() from within
a GObject e.g. by called g_bus_own_name() in constructed() and
g_bus_unown_name() in finalize() because on_name_lost() was delivered
in an idle.
With the way things work now, you are guaranteed to *never* get
callbacks if you call g_bus_unown_name() from the same thread from
where g_bus_own_name() was called....
Thanks,
David
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]