[PATCH] dbus-glib patches
rob.taylor at codethink.co.uk
Mon Mar 17 11:56:50 PDT 2008
Marcel Holtmann wrote:
> Hi Colin,
>>> Here's a few simple patches for dbus-glib.
>>> The first one is trivial, we just bump the version number.
>>> The second one is needed if you want to use the generated client glue
>>> and you have operations that lasts longer than the default timeout.
>> As Rob said I think we generally want to point people away from
>> increasing the timeouts, and it's worth mentioning something to this
>> effect in the docstring. But there are cases where it's useful, so
>> let's add this.
> it really depends on the situation. The Start/Stop/Cancel and can end
> up easily in a too complicated API. So turning users away from long
> timeouts in general is not the solution. It is a case by case thing
> which highly depends on the API and its actual usage.
> The advice that should be given to developers implementing these kind
> of APIs that require long timeouts, it is mandatory to document it. We
> might wanna add a annotation for the introspection. Just an idea.
The problem is a tad more complicated than what makes for the 'best'
api. As I said, the bus daemon has a timeout for method returns (set in
the config file, defaulting to 25s) and it returns you an error when a
method takes longer than this.
So don't use a method for anything that could possibly take longer (on
any system) than the bus timeout (and of course, you don't know what it
is as an application writer). As for why the timeout is there in the bus
daemon, i'm sure Havoc can explain better than me :)
More information about the dbus