Tracking whether a connection is alive

Owen Fraser-Green owen at discobabe.net
Thu Jul 15 03:38:25 PDT 2004


Hi,

> 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?

I feel rather uncomfortable with the notion of any application-application
interface passing natural language text. If you think about the chain of
actors involved (ignoring some bits in the middle which are just there to
make stuff work):

1. The user clicking a button
2. Client responding to button and trying to get the lock
3. HAL
4. Application holding the lock

then this proposal is allowing 4. to pass back something which means
nothing to anyone except 1. Thus we're asking 4. to make assumptions
assumptions about something with three degrees of seperation in between.
IMHO it's a bad thing for anything to assume something about anything
except it's closest neighbour.

You already touched on the internationalization issue but what if 4. is a
root process running on a system set to German locale while the user has
chosen French locale? What if 2. doesn't communicate to 1. through text at
all? In fact, the "Burning CD, 4:43 remaining" example isn't even just a
reason but a operation and a time remaining.

I do think the goals make a lot of sense though but text should be avoided
and HAL should stick to providing things which 2. can interpret. The
application name could be good so 2 can at least tell 1 "I'm sorry but I
cannot do foo at the moment because bar is currently using the CD-ROM
burner". In most cases it will be the user who ran 'bar' in the first
place so this message should make enough sense to them. Other information
such as "time before lock is freed" could be considered seperately.

Is there any reason for using a seperate call(s) to get this information
instead of using putting properties on the devices?

Cheers,
Owen


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



More information about the Hal mailing list