During browser send (processqueue), use Javasript timeout function instead of php sleep()

In lists/admin/actions/processqueue.php, REPLACE

sleep($delaytime); printf('<script type="text/javascript"> document.location = "./?page=pageaction&action=processqueue&ajaxed=true&reload=%d&lastsent=%d&lastskipped=%d%s"; </script></body></html>', $reload, $counters['sent'], $notsent, addCsrfGetToken());
with

if (defined('JSLEEPMETHOD')) { printf('<script type="text/javascript"> setTimeout(function() { document.location = "./?page=pageaction&action=processqueue&ajaxed=true&reload=%d&lastsent=%d&lastskipped=%d%s"; }, %d); </script></body></html>', $reload, $counters['sent'], $notsent, addCsrfGetToken(), $delaytime*1000); } else { sleep($delaytime); printf('<script type="text/javascript"> document.location = "./?page=pageaction&action=processqueue&ajaxed=true&reload=%d&lastsent=%d&lastskipped=%d%s"; </script></body></html>', $reload, $counters['sent'], $notsent, addCsrfGetToken()); }

also add

to config/config.php
NOTES
The amended section is only accessed in browser context, not by cron.
By using a define, if undeclared, current function is unchanged.
Allows for further expansion of this functionality by using various values of JSLEEPMETHOD
Instead of concurrent connections to same website/server hanging during the sleep() process, new method allows concurrent operations and ties up less resources

@sculptex Thanks for the patch! Normally we handle changes via Github pull requests. I’ve forwarded to @mariez and @michiel.

Thanks @samtuke. I think this is already merged https://github.com/phpList/phplist3/pull/157

Excellent, I had missed that. Thanks!