定制 icicleio/concurrent 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

icicleio/concurrent

最新稳定版本:v0.3.0

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.

Build Status Coverage Status Semantic Version MIT License @icicleio on Twitter

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-zts to 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.

统计信息

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

GitHub 信息

  • Stars: 172
  • Watchers: 13
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-01