2017 © Pedro Peláez
 

project workerman-thrift-resque

Thrift RPC and Resque based on workerman.

image

tumi/workerman-thrift-resque

Thrift RPC and Resque based on workerman.

  • Monday, November 7, 2016
  • by tumi
  • Repository
  • 1 Watchers
  • 8 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

workerman-thrift-resque

配置运行环境

配置教程, (*1)

安装Redis

安装教程, (*2)

安装使用Thrift

在线文档, (*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

管理队列(PHP)

添加作业, (*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)

The Versions

07/11 2016

dev-master

9999999-dev https://github.com/vtumi/workerman-thrift-resque

Thrift RPC and Resque based on workerman.

  Sources   Download

MIT

The Requires

 

by Avatar tumi

workerman resque thrift