承接 oefenweb/cakephp-queue 相关项目开发

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

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

oefenweb/cakephp-queue

最新稳定版本:v3.1.3

Composer 安装命令:

composer require oefenweb/cakephp-queue

包简介

A minimalistic Queue Plugin for CakePHP

README 文档

README

Build Status PHP 7 ready Coverage Status Packagist downloads Code Climate Scrutinizer Code Quality

Requirements

  • CakePHP 2.9.0 or greater.
  • PHP 7.0.0 or greater.

Installation

Clone/Copy the files in this directory into app/Plugin/Queue

Configuration

Ensure the plugin is loaded in app/Config/bootstrap.php by calling:

CakePlugin::load('Queue');

Ensure to configure the following lines in app/Config/bootstrap.php:

Configure::write('Queue.workers', 3);
Configure::write('Queue.sleepTime', 10);
Configure::write('Queue.gcprop', 10);
Configure::write('Queue.defaultWorkerTimeout', 2 * MINUTE);
Configure::write('Queue.defaultWorkerRetries', 4);
Configure::write('Queue.workerMaxRuntime', 0);
Configure::write('Queue.cleanupTimeout', DAY);
Configure::write('Queue.exitWhenNothingToDo', false);
Configure::write('Queue.gcOnExit', true);

Load schema:

Console/cake schema create;

Usage

Console

Run from your APP folder:

# Tries to call the `add()` function on a task.
Console/cake Queue.queue add <taskname>;
# Run a queue worker.
Console/cake Queue.queue runworker;
# Display some general statistics.
Console/cake Queue.queue stats;
# Manually call cleanup function to delete task data of completed tasks.
Console/cake Queue.queue clean;
# Manually call cleanup_failed function to delete task data of failed tasks.
Console/cake Queue.queue clean_failed;

Running only specific tasks per worker

You can filter "running" by type:

Console/cake Queue.queue runworker -t MyType,AnotherType,-ThisOneToo
Console/cake Queue.queue runworker -t "-ThisOneNot"

Use - prefix to exclude. Note that you might need to use "" around the value then to avoid it being seen as option key.

That can be helpful when migrating servers and you only want to execute certain ones on the new system or want to test specific servers.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-01