PHP code example of soderlind / redis-queue

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

    

soderlind / redis-queue example snippets


// wp-config.php
define( 'REDIS_QUEUE_HOST', '127.0.0.1' );
define( 'REDIS_QUEUE_PORT', 6379 );
define( 'REDIS_QUEUE_PASSWORD', 'your-password' );
define( 'REDIS_QUEUE_DATABASE', 0 );


define( 'REDIS_QUEUE_PORT', 6379 );
define( 'REDIS_QUEUE_DATABASE', 0 );

use Soderlind\RedisQueue\Jobs\Email_Job;

$job = new Email_Job([
  'email_type' => 'single',
  'to' => '[email protected]',
  'subject' => 'Hello',
  'message' => 'Testing queue'
]);
redis_queue()->queue_manager->enqueue( $job );

redis_queue_process_jobs(); // helper or via admin UI
bash
# Ubuntu/Debian
sudo apt-get install php-redis

# macOS with Homebrew
brew install php-redis

# CentOS/RHEL
sudo yum install php-redis