[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: [python] timeout during async call
From:       Simon McVittie <simon.mcvittie () collabora ! co ! uk>
Date:       2007-11-14 16:10:59
Message-ID: 20071114161059.GA21558 () carbon ! pseudorandom ! co ! uk
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 14 Nov 2007 at 16:03:53 +0100, René 'Necoro' Neumann wrote:
> Yes - it is waiting for the reply to be sent, as this function has to
> return in sync. - But the exception is thrown by DBus. How can an async
> call time out?

All D-Bus method calls time out (eventually), to avoid using up
resources in libdbus (in the caller, and also in the bus daemon). Pass
a keyword argument "timeout" to the asynchronous call, giving the
timeout you want in seconds (e.g. "timeout=25" which I believe is the default).

libdbus provides no way to wait forever, but you can set a timeout of up
to 2**31 milliseconds, so the maximum timeout= argument in Python is about
2 million seconds (or, more than than 23 days).

However, if you have many pending method calls in parallel, you may
start to hit resource limits in the bus daemon (it limits the number of
pending calls - I think it's to 32 on the system bus, and a million or so
on the session bus). You could consider using an API where the method returns
immediately, and progress/status thereafter is signalled by signals.

    Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFHOx4TWSc8zVUw7HYRAhaSAJ0QsuaYaPIyq9aN/ZzQE+I1DXn7MACgjzSp
NsiYjQFW+nke49xEeaZLy9A=
=rEHx
-----END PGP SIGNATURE-----
_______________________________________________
dbus mailing list
dbus@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic