mrpoundsign / pheanstalk-5.3
纯PHP5.3客户端,用于Beanstalk队列系统。所有荣誉归作者Paul Annesley所有
dev-master
2012-07-22 20:16 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-22 02:49:17 UTC
README
Pheanstalk是一个纯PHP 5.3+客户端,用于beanstalkd工作队列。自2008年底以来,它一直处于积极开发状态,并在生产中得到广泛应用。
由Paul Annesley创建,并由Brian Nelson修改以支持PHP 5.3命名空间。Pheanstalk经过严格的单元测试,并采用封装、可维护的面向对象设计编写。社区反馈、错误报告和补丁导致2010年发布了稳定的1.0.0版本。
支持beanstalkd的最新版本1.4。实现了beanstalkd 1.3协议文档中指定的所有命令和响应。
使用示例
<?php
// register Pheanstalk class loader
require_once('pheanstalk_init.php');
$pheanstalk = new \Pheanstalk('127.0.0.1');
// ----------------------------------------
// producer (queues jobs)
$pheanstalk
->useTube('testtube')
->put("job payload goes here\n");
// ----------------------------------------
// worker (performs jobs)
$job = $pheanstalk
->watch('testtube')
->ignore('default')
->reserve();
echo $job->getData();
$pheanstalk->delete($job);
?>
运行测试
# ensure you have simpletest
$ git submodule init
$ git submodule update
$ ./tests/runtests.php
All Tests
OK
Test cases run: 4/4, Passes: 103, Failures: 0, Exceptions: 0
# extra tests relying on a beanstalkd on 127.0.0.1:11300
$ ./tests/runtests.php --with-server
All Tests
OK
Test cases run: 7/7, Passes: 198, Failures: 0, Exceptions: 0
$ ./tests/runtests.php --help
CLI test runner.
Available options:
--with-server Includes tests which connect to a beanstalkd server
--testfile Only run the specified test file.
--help This documentation.
贡献者
- Paul Annesley
- Lachlan Donald
- Joakim Bick
- SlNPacifist
- leprechaun
- Peter McArthur
- robbiehudson
- Brian Nelson
- ..还有更多?如果遗漏了,请告诉我。
许可协议
(c) Paul Annesley
在MIT许可协议下发布