PHP code example of codeigniterext / queue

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

    

codeigniterext / queue example snippets

 
public $enabled = true;
public $discoverInComposer = true;
 
$queueConnection = 'codeigniter';
 
$queueConnection = 'pdo';

...
use CodeigniterExt\Queue\Queue;
use CodeigniterExt\Queue\Task;
...

$queue = new Queue();

$task = new Task;

$task
    ->setName('App/Controllers/SendMail')
    ->setData(
        array(
            'to'        => '[email protected]',
            'from'      => '[email protected]',
            'subject'   => 'Hi!',
            'text'      => 'It is your faithful Queue!'
        )
    )
    ->setPriority(Task::PRIORITY_NORMAL);

// Queue it
$queue->addTask($task);
shell
php spark queue:publish
shell
php spark migrate:latest
shell
php spark queue:work