PHP code example of mix-plus / queue

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

    

mix-plus / queue example snippets


// create queue
$queue = new RedisDriver([
                'default' => 'default',
                'host' => '127.0.0.1',
                'port' => 6379,
                'password' => '',
                'select' => 0,
                'timeout' => 0,
            ], [
                QueueHandleListener::class,
                QueueLengthListener::class,
                ReloadChannelListener::class,
            ]);

// start consume
// Swoole is coroutine run  go $queue->consume();
$queue->consume();