承接 milespong/dynamic-horizon 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

milespong/dynamic-horizon

Composer 安装命令:

composer require milespong/dynamic-horizon

包简介

A dynamic queue implementation based on Laravel Horizon

README 文档

README

This package can help to extend Laravel Horizon supervisors dynamically.

Feature

Laravel Horizon, which creating supervisors from the very beginning configurations, with a high constraint in horizon.php

Dynamic Horizon, which is based on Laravel Horizon, can create the supervisors dynamically despite the initial config file. This can be very helpful in a SaaS system

Install

Require this package with composer using the following command:

composer require milespong/dynamic-horizon

After updating composer, add the service provider to the providers array in config/app.php

MilesPong\Horizon\DynamicHorizonServiceProvider::class

Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Usage

Publish the config file dynamic-horizon.php

php artisan vendor:publish --provider="MilesPong\Horizon\DynamicHorizonServiceProvider" --tag=config

Set a value HORIZON_MASTER_ID in .env to indicate a identifier for current horizon master supervisor

Initialize Supervisors

In AppServiceProvider, add below code fragment in boot method

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', ...  
        ];  
    });  
}  

Deploy New Supervisors

When you want add the supervisors in other procedure rather than the bootstrap, use the way below

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', ...  
    ];  
});  

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固