PHP code example of lightster / hodor

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

    

lightster / hodor example snippets



return [
    'job_runner' => function($name, $params) {
        $container =  $params);
    },
];

use Hodor\JobQueue\JobQueue;

$job_queue = new JobQueue();
$job_queue->setConfigFile(__DIR__ . '/../../../config/hodor.php');
$job_queue->push(
    'Vendor\Project\SomeJob',           // job_name
    ['number' => 123, 'name' => 'Bob'], // job_params
    ['queue_name' => 'default']         // job_options
);
bash
cp vendor/lightster/hodor/config/dist/config.dist.php config/hodor.php

bin/hodor.php database:migrate config/hodor.php
bash
sudo php bin/hodor.php daemon:generate-config config/hodor.php
sudo service supervisord reload