承接 burriko/job-queue 相关项目开发

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

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

burriko/job-queue

最新稳定版本:0.1.0

Composer 安装命令:

composer require burriko/job-queue

包简介

Library to process jobs using Beanstalk.

README 文档

README

Build Status

Work in progress library to easily push jobs on to a queue so they can be processed outside of the web request. Currently only supports Beanstalk queues. API will break regularly until v1.

Usage

Firstly you need to create an instance of a Queue.

$pheanstalk = new Pheanstalk\Pheanstalk('localhost');
$queue = new JobQueue\BeanstalkQueue($pheanstalk, 'email_queue');

Creating jobs

You can then push Jobs on to the Queue.

$job = new JobQueue\Job('EmailClient', ['client_id' => $id]);
$queue->push($job);

This assumes that you have an EmailClient class with a method named handle that takes an argument of client_id. This will be called later when the job is retrieved from the queue and executed.

Processing the queue

This will listen for new jobs to be pushed to the queue, and then execute them.

$runner = new JobQueue\JobRunner();
$worker = new JobQueue\QueueWorker($queue, $runner);

$worker->processQueue();

To just process the next job you can do this.

$worker->processNextJob();

You can see what the QueueWorker is doing by passing in a logger that implements psr/log.

$runner = new JobQueue\JobRunner();
$logger = new Monolog\Logger('queue');
$worker = new JobQueue\QueueWorker($queue, $runner, $logger);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固