承接 studiobonito/silverstripe-queue 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

studiobonito/silverstripe-queue

Composer 安装命令:

composer require studiobonito/silverstripe-queue

包简介

Simple multi driver queue system.

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage

Overview

Simple multi driver queue system. This is essentially a port of the Laravel queue system.

Still very much a WIP not for use in production!

Although it would be better to use illuminate/queue directly it has too many dependancies that would replicate silverstripe/framework functionality at this time. By porting the code we can take advantage of SilverStripes command line framework and dependancy injection whilst still having a feature rich and multi backend queue system.

So our thanks go to Taylor Otwell et al for their excellent work on Laravel.

Requirements

  • SilverStripe 3.1 or newer.
  • pda/pheanstalk 2.1 or newer for Beanstalkd support

Supported Backends

  • Synchronous
  • SilverStripe Database
  • Beanstalkd
  • IronMQ
  • Amazon SQS
  • Redis

Installation Instructions

Composer

Run the following to add this module as a requirement and install it via composer.

$ composer require studiobonito/silverstripe-queue

Manual

Copy the 'queue' folder to your the root of your SilverStripe installation.

Configuration Overview

Configure the queue drivers with the following YAML.

StudioBonito\SilverStripe\Queue\QueueManager:
    default: 'db'
    db:
        driver: 'db'
        queue: 'default'
    beanstalkd:
        driver: 'beanstalkd'
        host: 'localhost'
        queue: 'default'
        ttr: 60

Usage Overview

Import QueueManager

Import the QueueManager class for ease of use.

use StudioBonito\SilverStripe\Queue\QueueManager;

Push A Job Onto The Queue

Use QueueManager::inst() to get an instance of the QueueManger class and then call the push() method passing in the name of a job handler and an array of data.

QueueManager::inst()->push('SendEmail', array('message' => $message));

Creating A Job Handler

Job handlers are simple classes that contain a run method with $job and $data parameters.

class SendEmail {

    public function run($job, $data)
    {
        // Code for processing job goes here.
    }
}

Contributing

Unit Testing

$ composer install --prefer-dist --dev
$ phpunit

License

All original work copyright of Taylor Otwell under MIT license. All subsequent work copyright Studio Bonito Ltd. under BSD-2-Clause license.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2014-06-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固