PHP code example of web-chefs / queue-butler

1. Go to this page and download the library: Download web-chefs/queue-butler 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/ */

    

web-chefs / queue-butler example snippets


'providers' => [
   // Other Service Providers
   WebChefs\QueueButler\QueueButlerServiceProvider::class,
];

// Create Batch Job Queue Processor Task
$scheduledEvent = $schedule->command('queue:batch --time-limit=280 --job-limit=1000 --sleep=10');

// Match cache expiry with frequency
// Set cache mutex expiry to One min (default is 1440)
$scheduledEvent->expiresAt = 5;
$scheduledEvent->everyFiveMinutes()
               ->withoutOverlapping()
               ->runInBackground();
 php
$schedule->command('queue:work --queue=default,something,somethingelse --max-time=50 --max-jobs=100 --sleep=10 --tries=3 --backoff=60')
         ->everyMinute()
         ->runInBackground()
         ->withoutOverlapping(1);
 php
$schedule->command('queue:batch --queue=default,something,somethingelse --time-limit=50 --job-limit=100 --sleep=10')
         ->everyMinute()
         ->runInBackground()
         ->withoutOverlapping(1);
 php
$schedule->command('queue:batch --time-limit=280 --job-limit=1000 --sleep=10')
         ->everyFiveMinutes()
         ->runInBackground()
         ->withoutOverlapping(5);
 php
// Low volume queues
$schedule->command('queue:batch --queue=default,something,somethingelse --time-limit=50 --job-limit=100 --sleep=10')
         ->everyMinute()
         ->runInBackground()
         ->withoutOverlapping(1);

// High volume dedicated "notifications" queue
$schedule->command('queue:batch --queue=notifications, --time-limit=175 --job-limit=500 --sleep=2')
         ->everyThreeMinutes()
         ->runInBackground()
         ->withoutOverlapping(1);