RequestName default flags

Kalle Vahlman kalle.vahlman at gmail.com
Thu Aug 4 03:38:48 EST 2005


On 8/3/05, Havoc Pennington <hp at redhat.com> wrote:
> Hi,
> 
> Since only Waldo seems to be following up ;-) what about this proposal:

I was about to, but got caught up in work and forgot and...
 
>  - default is PROHIBIT_REPLACEMENT, new optional flag is
>    ALLOW_REPLACEMENT

Was about suggest this way, since I'd think any service provider wants
to stay as owner more often than not.

If you allow replacement by default, any accidental launching of an
service provider could force clients to reset, if the service is
state-dependant.

Scenario:
Launch IM client, a status applet finds the service and queries status
(of buddies). Launch it again, the applet gets NameOwnerChanged and
has to query again. And again, when the accidentally opened client is
closed.

This could be even worse with multiple service providers kicking each other.

>  - default regardless of PROHIBIT vs. ALLOW_REPLACEMENT is to
>    queue up to own the name later and return IN_QUEUE

Sounds logical to default to second-best option.

>  - flag DO_NOT_QUEUE will cause an error rather than IN_QUEUE
>    if name is already owned

Also is logical, as it is specifically requested not to queue.

>  - flag REPLACE_EXISTING will cause replace current owner if
>    ALLOW_REPLACEMENT is set, and if PROHIBIT_REPLACEMENT is
>    set will return an error or add to queue depending on the
>    DO_NOT_QUEUE flag

Sounds like a plan to me.
 
> But ignoring here whether we should move the flags to the .service file.
> With this proposal maybe there's no need to... don't know.

Unless it's overridable from code, no. You might want to alter the
behaviour based on runtime environment. OTOH, setting the default in
.service would be a nice reference point for 3rd parties to look up if
they can replace a service without digging in the code. I guess I'm
saying "both" :)

-- 
Kalle Vahlman, zuh at iki.fi


More information about the dbus mailing list