pecl-dbus
pecl-dbus copied to clipboard
Add support for setting method call timeout
Thorough review would be appreciated. This is the first time I'm working on a PHP extension. I already had some "fun" with memory corruption because I added the new variable at the end of php_dbus_obj
at first, not realising there's some magic going on with zend_object
.
For some D-Bus services the default D-Bus timeout (25s) may not be enough; conversely for some applications the default timeout may be much longer than they'd like to wait.
Add support for setting the timeout to use for method invocations globally. At least for PHP < 8 this is probably the best we can do as there is no way to pass additional timeout information to individual method calls: we cannot reliably tell whether a positional parameter (to __call()
) is the optional timeout or a parameter for the D-Bus method to invoke.
For PHP 8+ it may be possible to use named arguments to pass a per-invocation timeout parameter but that's left for the future as I cannot test it.
Are you still interested in getting this PR finished up? It's so close now.
Are you still interested in getting this PR finished up? It's so close now.
Yes, I am. Sorry for taking so long. I'd like to test my changes before updating the MR but I'm currently busy with components on a different system and don't get around to test pecl-dbus. :(