PHP code example of dominaentregatotal / php-bull-scheduler

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

    

dominaentregatotal / php-bull-scheduler example snippets




ominaEntregaTotal\BullScheduler\Queue;

// You can specify any value for Redis that Predis considers valid for the first parameter of Predis\Client
$queue = new Queue('name-queue', 'tcp://localhost:6379');
$queue2 = new Queue('name-queue', ['redis' => ['host' => 'localhost', 'port' => 6379]]);
$queue3 = new Queue('other-queue', new Predis\Client());

$job_id = $queue->add(['data' => 'value']);

// with process name and options
$job_id = $queue->add('name-process', [
                            'key' => 'value',
                        ], [
                            'attempts'  => 3, // try 3 attemps
                            'delay'     => 1000, // delay 1 second in miliseconds
                        ]);