org.freedesktop.DBus.GLib.Async GLib specific ?

Thiago Macieira thiago at kde.org
Fri Sep 8 06:15:35 PDT 2006


frederic heem wrote:
>Not yet, dbus-binding-tool has these feature, for the my application,
>asynchronous call is mandatory. So either I modified dbusxml2cpp to
> support asynchronous call or I dropped Qt on the client side use in
> favor of glib binding. since I prefer Qt over glib, I'll go for the
> first solution.

I'd like to see the patch if possible. It might be interesting to add to a 
later version of the tool, as an optional switch. I'd rather avoid 
introducing another annotation (dbusxml2cpp already has too many).

>Why ? Could you comment with a valid reason ?
>Do you know a project that uses dbus asynchronous call ? So far, google
> found only one library that has one occurrence of the annotation
>org.freedesktop.DBus.GLib.Async, then looking at the code shows they
> misused this keyword, indeed, the notify_daemon_notify_handler is a
> *synchronous* call, indeed, dbus_g_method_returns is called inside
>notify_daemon_notify_handler !
>So far, no one is really using the asynchronous annotation.

Asynchronous in the sense that GLib uses means that the method call will 
be posted and control will return immediately to the caller. The callee's 
reply will come later, in a callback (in Qt terms, a slot).

But QtDBus uses a restricted meaning of the term "asynchronous", 
indicating instead the NoReply concept: it means there will be no reply 
at all, so the caller doesn't need to wait for the completion from the 
callee. Method calls in this case are sent with the "no-reply" flag set, 
indicating that the callee doesn't have to bother sending a reply message 
either (which it is otherwise mandated to do).

>> You want to place a call using callWithCallback.
>
>You missed the whole point, I don't want to write hand written code when
> a tool can do it for me in a better and faster way, and without error.
> The idea is to use dbusxml2cpp to generate callWithCallback calls
> automatically.

It was part of the requested features for QtDBus when I did one of its API 
Reviews with other Trolltech developers. But I deemed it too complex to 
be implemented in the initial version and, since most of the users of 
QtDBus will come from KDE DCOP-ported code (which had a very complex way 
of implementing this), I didn't judge it to be necessary from the outset.

But, if you implemented the code, it might be interesting to apply it to 
the tool.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060908/ed5da146/attachment.pgp


More information about the dbus mailing list