icicleio/concurrent
Composer 安装命令:
composer require icicleio/concurrent
包简介
Concurrency component for Icicle.
关键字:
README 文档
README
True concurrency using native threading and multiprocessing for parallelizing code, without blocking.
This library is a component for Icicle that provides native threading, multiprocessing, process synchronization, shared memory, and task workers. Like other Icicle components, this library uses Coroutines built from Awaitables and Generators to make writing asynchronous code more like writing synchronous code.
This library provides a means of parallelizing code without littering your application with complicated lock checking and inter-process communication.
To be as flexible as possible, this library comes with a collection of non-blocking concurrency tools that can be used independently as needed, as well as an "opinionated" worker API that allows you to assign units of work to a pool of worker threads or processes.
Documentation and Support
Requirements
- PHP 5.5+ for v0.3.x branch (current stable) and v1.x branch (mirrors current stable)
- PHP 7 for v2.0 (master) branch supporting generator delegation and return expressions
Suggested
- pthreads extension: Best extension option for concurrency in PHP, but it requires PHP to be compiled with
--enable-maintainer-ztsto enable thread-safety. - pcntl extension: Enables forking concurrency method.
- sysvmsg extension: Required for sharing memory between forks or processes.
Installation
The recommended way to install is with the Composer package manager. (See the Composer installation guide for information on installing and using Composer.)
Run the following command to use this package in your project:
composer require icicleio/concurrent
You can also manually edit composer.json to add this library as a project requirement.
// composer.json { "require": { "icicleio/concurrent": "^0.3" } }
Development and Contributing
Interested in contributing to Icicle? Please see our contributing guidelines in the Icicle repository.
Want to hack on the source? A Vagrant box is provided with the repository to give a common development environment for running concurrent threads and processes, and comes with a bunch of handy tools and scripts for testing and experimentation.
Starting up and logging into the virtual machine is as simple as
vagrant up && vagrant ssh
Once inside the VM, you can install PHP extensions with Pickle, switch versions with newphp VERSION, and test for memory leaks with Valgrind.
icicleio/concurrent 适用场景与选型建议
icicleio/concurrent 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 35.97k 次下载、GitHub Stars 达 172, 最近一次更新时间为 2015 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「stream」 「async」 「asynchronous」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 icicleio/concurrent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 icicleio/concurrent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 icicleio/concurrent 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Asynchronous coroutines for PHP 7.
Object-Oriented API for PHP streams
The bundle for easy using json-rpc api on your project
An async event for hyperf.
Safely namespaced guzzle psr7 for WP2Static
Symfony ResqueBundle
统计信息
- 总下载量: 35.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 173
- 点击次数: 31
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-01