publero/net_gearman
Composer 安装命令:
composer require publero/net_gearman
包简介
Gearman (http://www.danga.com/gearman) is a system to farm out work to other machines. It can load balance function calls to lots of machines and allows you to call functions between languages. It can also run all function calls in parallel.
README 文档
README
PHP library for interfacing with Danga's Gearman. Gearman is a system to farm out work to other machines, dispatching function calls to machines that are better suited to do work, to do work in parallel, to load balance lots of function calls, or to call functions between languages.
Installation
Add following line to your composer.json require
"publero/net_gearman": "1.0.x-dev"
You can use following command
composer.phar require --dev publero/net_geaman:1.0.x
Examples
Client
<?php $client = new \Net\Gearman\Client(); $client->addServer(); $result = $client->doNormal('replace', 'PHP is best programming language!'); $client->doBackground('long_task', 'PHP rules... PHP rules...');
Worker
<?php $function = function($payload) { return str_replace('java', 'php', $payload); }; $worker = new \Net\Gearman\Worker(); $worker->addServer(); $worker->addFunction('replace', $function); $worker->work();
Versioning
This library uses semantic versioning.
License
This library is under the new BSD license. See the complete license:
[LICENSE](index.md)
About
I've started working on this because you can't compile PECL gearman extension on windows where i need to use this code. Goal of this project is to make copy of the PECL gearman extension and allow PHP developers to use them in same way.
Bugs and requests
Feel free to report bugs, request a feature or make a pull request. If you want something new in a bundle we would like to know about it. Make sure that you've checked already opened issues as your bug or feature request might already be in issue list.
统计信息
- 总下载量: 78.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: New
- 更新时间: 2013-03-19