dbus signals
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Feb 14 05:02:07 PST 2007
On Tue, 13 Feb 2007 at 16:53:52 -0500, John (J5) Palmieri wrote:
> The correct way to deal with this is for applications to request state
> from names on the bus they care about and then start listening for
> signals to deal with state change.
That has a race condition; a better way would be to start listening for
signals to deal with state change, then request state via method calls
(i.e. same mechanisms, other way round). Otherwise you run the risk of
missing a state change that happens after the method returns, but before
you get the signal handler in place.
A lot of the time (in Python at least) you can even use the same callback for
the asynchronous method reply and the signal response.
More information about the dbus
mailing list