codeages / plumber
A PHP Message Queue Worker.
Installs: 7 281
Dependents: 2
Suggesters: 0
Security: 0
Stars: 23
Watchers: 4
Forks: 2
Open Issues: 1
Requires
- php: >=5.4.1
- ext-swoole: >=1.7.17
- codeages/beanstalk-client: ^0.1
- codeages/rate-limiter: ^0.2
- docopt/docopt: ^1
- monolog/monolog: ^1
- pimple/pimple: ^3
Requires (Dev)
- eaglewu/swoole-ide-helper: dev-master
- phpunit/phpunit: ^4|^5|6
README
消息队列的Worker守护进程,目前支持beanstalkd。
运行环境
- PHP >= 5.4.1
- Swoole >= 1.7.18
- Linux / Mac OSX
安装
composer require codeages/plumber
使用
Plumber 0.6.0
Usage:
bin/plumber (run|start|restart|stop) [--bootstrap=<file>]
Options:
-h|--help show this
-b <file> --bootstrap=<file> Load configuration file [default: plumber.php]
启动
bin/plumber start -b bootstrap-file-path # `bootstrap-file-path`为启动配置文件路径
重启
bin/plumber restart -b bootstrap-file-path
停止
bin/plumber stop -b bootstrap-file-path
Bootstrap启动配置文件说明
Bootstrap启动配置文件,必须返回Pimple\Container
类型的配置对象,情参考example/bootstrap.php文件。
Worker的写法
请参考example/Example1Worker.php。
Worker执行的返回值
请参考src/IWorker.php。
Docker
启动
docker-compose up
Example Put Message
docker exec YOUR_CONTAINER_ID php example/put_message.php
Changelog
See CHANGELOG.md.
License
MIT.