mak/phing-foreach-parallel-task
最新稳定版本:v1.0.0
Composer 安装命令:
composer require mak/phing-foreach-parallel-task
包简介
phing task to run sub-tasks in a foreach-loop in separate, parallel processes
README 文档
README
Maintainer Contact
Matthias Krauser mail: matthias@krauser.eu twitter: @mat_krauser
Changelog
1.0.0 (2014-10-27)
- initial release
Documentation
The foreach-parallel-task for phing behaves exactly like the normal foreach-task. From the documentation of the foreach-task:
The foreach task iterates over a list, a list of filesets, or both. If both, list and filesets, are specified, the list will be evaluated first. Nested filesets are evaluated in the order they appear in the task.
The only difference is, that the iterations are not executed sequentially but parallel. It like a foreach-version of phing's ParallelTask.
This only works on *nix machines with pcntl-extension installed. If the requirements are not fullfilled, the foreach-parallel-task will behave like a regular foreach-task.
Installation
The suggested installation method is via composer:
php composer.phar require "doctrine/instantiator:~1.0.3"
Usage
- Load the task in your phing build-file
<taskdef name="foreach_parallel" classname="MaK\Phing\Task\ForeachParallelTask" />
- Call the task:
The syntax is exactly the same as the original task. The only difference is the optional
threadCount-Attribute, to specify the maximum number of threads / processes to use. If not specified, the library will try to guess the best number.
<foreach_parallel list="..." param="some_param" target="target-task" threadCount="4"/>
Credits
This library task was heavily inspired by ParallelTask from Michiel Rook (mrook@php.net), which is part of the Phing-Core.
mak/phing-foreach-parallel-task 适用场景与选型建议
mak/phing-foreach-parallel-task 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.53k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2014 年 10 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mak/phing-foreach-parallel-task 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mak/phing-foreach-parallel-task 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-27