pekkis/queue 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pekkis/queue

Composer 安装命令:

composer require pekkis/queue

包简介

Queue abstraction library

README 文档

README

Build Status

A small, opinionated queue abstraction library based on discovered needs. Extracted from Xi Filelib and other assorted projects.

What does it do?

A message consists of a topic and arbitrary data (basic serializable data supported by default, custom serializers can be added). Messages are moved and grooved through a queue. The library extracts a simple, 80/20 like domain for it's method of operation and abstracts away the differences in message queue backends.

Status

The project is purely in maintenance mode. I have "moved on" since, code mostly JS & React these days.

If you want to maintain this, holler!

Quickstart

<?php

namespace Pekkis\Queue\Example;

use Pekkis\Queue\Adapter\IronMQAdapter;
use Pekkis\Queue\Message;
use Pekkis\Queue\Queue;

require_once (is_file(__DIR__ . '/bootstrap.php')) ? __DIR__ . '/bootstrap.php' : __DIR__ . '/bootstrap.dist.php';

// Create a new IronMQ backed queue
$queue = new Queue(
    new IronMQAdapter(IRONMQ_TOKEN, IRONMQ_PROJECT_ID, 'pekkis-queue-example')
);

// Queues can be emptied.
$queue->purge();

// A message consists of a topic and data. A message instance with an UUID you can use is returned.
$message = $queue->enqueue(
    'pekkis.queue.example',
    array(
        'some' => 'random data'
    )
);

// Dequeue and process a single message
$received = $queue->dequeue();
$data = $received->getData();
var_dump($data);

// Acknowledge the message (you're done with it)
$queue->ack($received);

A better example

For an end-to-end example with IronMQ and a "real life" scenario, see the folder examples.

Also see Xi Filelib (v0.10+) for actual real use case from the real world!

Ideas / wishes? Contact or create a pull request! Cheers!

Supported queues

  • RabbitMQ (via PECL and pure PHP).
  • IronMQ
  • Amazon SQS

Version upgrades

Refer to the change log

统计信息

  • 总下载量: 129.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-01-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固