Use the throttle to control the speed.
use GW\Throttler\Throttler;
$throttler = new Throttler(1.0);
foreach ($heavyTasks->all() as $task) {
$throttler->throttle(); // wait a second... before next task
$task->run();
}
Simple PHP execution throttler.
Use the throttle to control the speed.
use GW\Throttler\Throttler;
$throttler = new Throttler(1.0);
foreach ($heavyTasks->all() as $task) {
$throttler->throttle(); // wait a second... before next task
$task->run();
}
Simple PHP execution throttler.
MIT License