PHP code example of randika-srimal / queue-manager
1. Go to this page and download the library: Download randika-srimal/queue-manager library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
randika-srimal / queue-manager example snippets
return [
'workers' => [
[
'connection' => 'database',
'queue' => 'default',
'processes' => 3,
'memory' => 128, // Maximum memory in MB before restart
'timeout' => 60, // Maximum execution time per job in seconds
'sleep' => 3, // Seconds to sleep when no jobs available
'tries' => 3, // Number of times to attempt a job
],
[
'connection' => 'redis',
'queue' => 'high-priority,default',
'processes' => 5,
'memory' => 256,
'timeout' => 60,
'sleep' => 1,
'tries' => 3,
],
],
'memory_check_interval' => 30, // How often to check memory (seconds)
'restart_delay' => 2, // Delay before restarting a worker (seconds)
];