pecl-dbus icon indicating copy to clipboard operation
pecl-dbus copied to clipboard

Add support for setting method call timeout

Open silbe opened this issue 2 years ago • 2 comments

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.

silbe avatar Jun 23 '22 17:06 silbe

Are you still interested in getting this PR finished up? It's so close now.

derickr avatar Sep 12 '22 10:09 derickr

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. :(

silbe avatar Oct 03 '22 13:10 silbe