akbansa/parallel-processor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

akbansa/parallel-processor

最新稳定版本:v1.0

Composer 安装命令:

composer require akbansa/parallel-processor

包简介

Parallel Processor will help you do run commands for parallel execution

README 文档

README

An easy way to run multiple commands in parallel in laravel.

Install

Install via composer

composer require akbansa/parallel-processor

Usage

Import Akbansa\LaravelParallelProcessor\ParallelProcessor where you want to use this parallel processor.

$processor = new ParallelProcessor($tasks, $options);
$processor->start();

while (!$processor->isFinished()) {
    sleep(1);
}

$tasks can be an array or collection of tasks that needs to be run and each item of this $tasks should have command as it's one of the property that need to be run.

For example

$tasks = [
    ["id" => 1, "command" => "php artisan send:email abc@example.com"],
    ["id" => 2, "command" => "php artisan send:email example@domain.com"]
]

$options is an optional parameter in which you can pass parameters in an array as follow:

1. $parallelCount => This can be used to define the number parallel processes to be executed (default: 3)
2. $estimateProcessTime => average estimate time for process in second (default 1)

License

The MIT License. Please see the License File

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-05-01