定制 mavimo/disque-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mavimo/disque-client

Composer 安装命令:

composer require mavimo/disque-client

包简介

PHP Client for Disque

README 文档

README

Build status

The current project is a PHP client for disque. As specified in the project page disque is ongoing experiment to build a distributed, in memory, message broker. Its goal is to capture the essence of the "Redis as a jobs queue" use case.

WARNING: Like disque this project alpha code NOT suitable for production. The implementation and API will likely change in significant ways during the next months. The code and algorithms are not tested enough. A lot more work is needed.

Installing via Composer

The recommended way to install disque client is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest version of Disque Client:

composer.phar require mavimo/disque-client

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

Usage

This is a simple code snippet on how to use the Disque Client:

require 'vendor/autoload.php';

$socket = new Mavimo\Disque\Client\Socket('127.0.0.1', 7711);
$client = new Mavimo\Disque\Client\Client($socket);

$queue = new Mavimo\Disque\Queue\Queue('mytest');

$body = json_encode([
    'foo' => true,
    'bar' => 'Lorem ipsum',
]);

$jobA = new Mavimo\Disque\Job\Job($body);
$jobB = new Mavimo\Disque\Job\Job($body);
$jobC = new Mavimo\Disque\Job\Job($body);

$client->push($queue, $jobA);
var_dump($jobA);
$client->push($queue, $jobB);
var_dump($jobB);
$client->push($queue, $jobC);
var_dump($jobC);

$job1 = $client->fetch($queue);
var_dump($job1);
$job2 = $client->fetch($queue);
var_dump($job2);
$job3 = $client->fetch($queue, 1);
var_dump($job3);
$job4 = $client->fetch($queue, 1);
var_dump($job4);

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固