承接 flyio/laravel-workers 相关项目开发

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

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

flyio/laravel-workers

最新稳定版本:0.1.0

Composer 安装命令:

composer require flyio/laravel-workers

包简介

Auto-scaled queue workers on Fly.io

README 文档

README

This package will create Fly.io Machines machines on-demand as needed when your queue worker reaches certain thresholds.

Installation

You can install the package via composer:

composer require fly/laravel-workers

You can publish the config file with:

php artisan vendor:publish --tag="config"

This is the contents of the published config file:

return [
    'app_name' => env('FLY_APP_NAME'),
    'api_key' => env('FLY_API_KEY'),
    'region' => env('FLY_REGION'),
    'image' => env('FLY_IMAGE_REF'),
    'min_workers' => 2,                 // Number of base workers, always present
    'max_workers' => 10,                // Scale to a max of this many workers
    'scale_controller' => [             // Scale up as directed by this scaler
        'class' => \Fly\Worker\Scalers\JobsPerWorker::class,
        'jobs_per_machine' => 10,
    ],
    'vm' => [
        'cpu_kind' => 'shared', // vs dedicated
        'cpus' => 1,
        'memory_mb' => 1024
    ],
    'connection' => null, // default
    'queue' => null, // default
];

Usage

Add the fly:work command to your scheduler to run once a minute, on one server:

$schedule->command('fly:work')
    ->onOneServer()
    ->everyMinute();

This command will scale up (and down) queue workers on Fly.io machines as directed by the Scaler class.

This assumes you are running your Laravel application on Fly.io as well!

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 48
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固