dev-master
9999999-dev https://github.com/vtumi/workerman-thrift-resqueThrift RPC and Resque based on workerman.
MIT
The Requires
by tumi
workerman resque thrift
Thrift RPC and Resque based on workerman.
配置教程, (*1)
安装教程, (*2)
在线文档, (*3)
Composer, (*4)
composer create-project --prefer-dist tumi/workerman-thrift-resque:dev-master
普通作业, (*5)
namespace App\Resque\Job; class Demo { public function perform() { \Workerman\Worker::log($this->args['str']); } }
启动, (*6)
php start.php start -d
重启, (*7)
php start.php restart
平滑重启, (*8)
php start.php reload
查看状态, (*9)
php start.php status
停止, (*10)
php start.php stop
添加作业, (*11)
Resque::setBackend('127.0.0.1:6379'); $args = ['str' => 'This is a test!']; $id = Resque::enqueue('default', 'Demo', $args);
删除作业, (*12)
Resque::setBackend('127.0.0.1:6379'); Resque::dequeue('default', ['Demo']); Resque::dequeue('default', ['Demo' => $id]); Resque::dequeue('default', ['Demo' => ['str' => 'This is a test!']]); Resque::dequeue('default', ['Demo1', 'Demo2']);
查询状态, (*13)
Resque::setBackend('127.0.0.1:6379'); // Resque::enqueue('default', 'Demo', $args, true); 添加作业时 $id = ''; $status = new Resque_Job_Status($id); $status->get();
通过Thrift RPC(参考client.php), (*14)
Thrift RPC and Resque based on workerman.
MIT
workerman resque thrift