← Back to team overview

ubuntu-phone team mailing list archive

Re: LP: #1260712 post-mortem and improving our processes

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/18/2013 07:04 PM, Barry Warsaw wrote:
> On Dec 17, 2013, at 02:25 PM, Alberto Mardegan wrote:
> 
>> In fact, it was not necessary: the ApplyUpdate() could have
>> stayed as it was, and yet be processed asynchronously, allowing
>> the main loop to continue running.  I'm not sure if that's
>> possible to do with the python "dbus" module, but it certainly is
>> with python + Gio (via GLib introspection).
> 
> Not only possible, but trivial!  In fact, that's what Didier's
> patch implements:
> 
> http://tinyurl.com/n5shrfy

No, that's not how an asynchronous D-Bus method is implemented! :-)

> The problem is that it's also kind of useless!  The async version
> of the method can only return a hardcoded string, so the "no error"
> empty string is used.  But what if there is an error applying the
> update?  The async version can only report that via signal, thus
> the new Rebooting signal.

No, please have a look at the links which Martin Pitt posted:

http://dbus.freedesktop.org/doc/dbus-python/api/dbus.service-module.html#method

http://stackoverflow.com/questions/2142115/implementation-of-an-async-method-in-python-dbus

You *can* write a method which is invoked by DBus and which doesn't
cause a reply to be emitted when it returns. Instead, the reply will
be emitted at a later time, by invoking either the success callback or
the error callback which were given to you when your D-Bus method was
called.

Ciao,
  Alberto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKzC8MACgkQVLQegMXeCFKe6gCcDKuoXB9St2m48Y3uVXyrij0S
HlsAn1Pz7cYEXv19JZYxXiwPPYNqjntf
=NRFq
-----END PGP SIGNATURE-----


References