[PATCH] Third and Final (hopefully)

Robert McQueen robert.mcqueen at collabora.co.uk
Wed Nov 9 03:35:00 PST 2005


Havoc Pennington wrote:
> One rationale was that the defaults are the things you don't have to
> write code for. i.e. to handle DO_NOT_QUEUE you need to detect the error
> trying to get the name and exit or something;

I don't see this at all. The programmer always has to check the return
value to their function. To handle being on the queue, you have to watch
for signals to know if you've actually got the name or not. It seems
like more work in the queue-by-default case. If you call the function to
get a name and it says "yes you have it" or "no you don't", this is trivial.

> The other thing to consider is what are the use-cases, i.e. the defaults
> should be for some common scenario (the "several different text editors"
> example maybe) and the non-defaults are for some other setup.
> 
> I don't think "no replacement" and "no queue" is right for the text
> editor scenario, so it isn't a good default if we anticipate that as the
> most common scenario.

This is a use case *for the queueing functionality*. Even if it's the
most common one for the queue, I don't anticipate this as the common
case for most users of the bus in general, where names will either be
held by one person or not at all.

> Another scenario is "unique application" where if the name is already
> owned you want to pass on the new windows to open and exit, otherwise
> you own the name. In this case you want "no queue" / "no replacement"
> probably. But you also have to write some tricky code and there's
> probably going to be a library function that deals with it (already is
> in KDE)

This is the more common case in my opinion, and certainly this is how
most current bus users work, with service activation to activate the
single desired instance. Queueing is a more elaborate scenario which you
should choose to get into if you wish, hence "no queue"/"no replacement"
being my suggestion for the default.

> Don't remember the other scenarios... maybe someone wrote them down
> somewhere ? ;-)

I'd be interested, not many people could think of any at the BOF at the
GNOME summit.

> Havoc

Regards,
Rob


More information about the dbus mailing list