PHP code example of milespong / dynamic-horizon

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

    

milespong / dynamic-horizon example snippets

  
composer 
  
MilesPong\Horizon\DynamicHorizonServiceProvider::class
  
php artisan vendor:publish --provider="MilesPong\Horizon\DynamicHorizonServiceProvider" --tag=config
  
use \MilesPong\Horizon\DynamicHorizonSupervisor;  
  
...  
  
public function boot()  
{  
    $this->app->make(DynamicHorizonSupervisor::class)->initial('YOUR_MASTER_ID', function () {  
        return [  
            'supervisor-1' => [  
                'connection' => 'redis',  
                'queue' => ['foo'],  
                'balance' => 'auto',  
                'processes' => 10,  
                'tries' => 3,  
                'sleep' => 3,  
            ],  
            // 'supervisor-2', 'supervisor-3', ...  
        ];  
    });  
}  
  
use \MilesPong\Horizon\DynamicHorizonSupervisor;  
  
app()->make(DynamicHorizonSupervisor::class)->add('YOUR_MASTER_ID', function () {  
    return [  
        'supervisor-1' => [  
            'connection' => 'redis',  
            'queue' => ['foo'],  
            'balance' => 'auto',  
            'processes' => 10,  
            'tries' => 3,  
            'sleep' => 3,  
        ],  
        // 'supervisor-2', 'supervisor-3', ...  
    ];  
});