asynchronous error reporting

Ross Burton ross at burtonini.com
Thu Oct 27 04:33:54 PDT 2005


On Thu, 2005-10-27 at 12:16 +0100, Robert McQueen wrote:
> The glib bindings have the effect that in the service, the method is
> invoked synchronously, whether or not the client has made an
> asynchronous or a synchronous invocation. This means that when doing
> something that is time-consuming, such as interacting with the network,
> the service process is blocked within that particular function.
> Accordingly we've made most methods just return nothing, and using
> signals to indicate whether or not changes have taken place.

Add the org.freedesktop.DBus.GLib.Async attribute to your methods and
you'll get async server-side bindings.  These don't return anything and
are passed a DBusGMethodInvocation*, which is used to return a
result/error.  In the bound method you could start a thread or start an
operation and wait for it to complete in the mail loop.  For an example
of use, see eds-dbus, addressbook/libedata-book-dbus/e-data-book.c

Ross
-- 
Ross Burton                                 mail: ross at burtonini.com
                                          jabber: ross at burtonini.com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF





More information about the dbus mailing list