PHP code example of ninoslavjaric / queue-manager

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

    

ninoslavjaric / queue-manager example snippets


return [
    'driver' => env('CUSTOM_QUEUE_DRIVER', 'eloquent'),
    'queue-pool-limit' => 2,
    'drivers' => [
        'eloquent' => \Nino\CustomQueueLaravel\Services\QueueManager\Eloquent::class,
        'redis' => \Nino\CustomQueueLaravel\Services\QueueManager\Redis::class,
    ],
    // Optional: Limit queueable classes
    'whitelisted_classes' => [],
    'blacklisted_classes' => [],
    'task-class' => \Nino\CustomQueueLaravel\Models\CustomQueueTask::class
];

$schedule->command('custom-queue:daemon')->everyTwoSeconds();
bash
   php artisan migrate
   
bash
   php artisan schedule:run
   
txt
[2024-11-21 20:36:47] local.INFO: [nino/app/Services/QueueManager.php:219] {"flag":"custom-queue:daemon","queuePoolLimit":3} -----> Cancelling tasks that aren't running in system
txt
  [2024-11-21 20:36:47] local.INFO: [nino/app/Services/QueueManager.php:246] {"flag":"custom-queue:daemon","queuePoolLimit":3,"tasksExtractedCount":2,"cmd":"'\/usr\/local\/bin\/php' '\/var\/www\/html\/artisan' 'custom-queue:task-bg-execute' '4919f8b9-06b9-4902-a96f-80c9bd7a8203'"} -----> Running task in background