Tracking whether a connection is alive

David Zeuthen david at fubar.dk
Wed Jul 14 12:39:57 PDT 2004


On Wed, 2004-07-14 at 02:11 +0200, Kay Sievers wrote:
> What kind of applications you are thinking of? If they use HAL to get a
> device lock, shouldn't they be able to watch for device changes(disconnect)
> by async messages anyway?
> 

You don't have to; the hal_[get|set]_property_* functions are indeed
synchronous (which reminds me that we want to asynchronous version as
well); it's perfectly sane not to integrate the DBusConnection into the
mainloop; look at the HAL commandline tools for examples.

It's kind of a design decision as integration of the DBusConnection
into a mainloop is difficult and not all applications use the glib or
Qt mainloop (for which libdbus-glib and libdbus-qt provides nice and
easy integration functions).

> The interesting part of providing the "busy reason" directly to other
> applications instead of setting a property on HAL, is the ability to have
> real time updates instead of a static string. It would be possible this
> way, to let other applications know about the progress of a operation.
> 
> The other nice side effect is, that if the application is not responding
> to the request or the "busy reason" does not make sense to the user, the
> user can take the appropriate action. The static info string should be
> provided for this case anyway, to identify the dead application.
> 
> Hmm, don't know if this will work. I'm just a bit excited about the
> feature :)
> 

I think it's nice as well; the CD burner could export "Burning CD, 4:43
remaining" :-)

So.. How about making HAL export the name of the connection, e.g. :42-0,
as info.locked.dbus_connection and then it's _optional_ to implement the
interface org.freedesktop.Hal.LockHolder on the object denoted by the
UDI of the device being locked? This interface got two methods 

 string GetApplicationName(string locale);
 string GetReason(string locale);

We should of course provide a nice callback for this in libhal.

So.. opinions?

Cheers,
David
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list