承接 eo/subway 相关项目开发

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

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

eo/subway

Composer 安装命令:

composer require eo/subway

包简介

Nuclear reactor powered background job processing for PHP

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage Total Downloads Latest Stable Version

Nuclear reactor powered background job processing for PHP.

Features

  • Delayed jobs
  • Repeating jobs
  • Resque compatible db
  • Configurable logging
  • Supports composer and symfony based apps out-of-box

Requirements

  • A POSIX-oriented operating system (No windows support due to pcntl dependency)
  • PHP >= 5.4 (with pcntl)
  • Redis

Installation

Add Subway in your composer.json:

{
    "require": {
        "eo/subway": "dev-master"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update eo/subway

Composer will install everything into your project's vendor directory.

Usage

Creating job classes

To create a new job, extend your job class to Subway\Job and implement abstract method perform.

<?php

use Subway\Job;

class MyAwesomeJob extends Job
{
    public function perform()
    {
        // do something here
    }
}

Queueing jobs

<?php

use Predis\Client;
use Subway\Factory;

$redis  = new Client();
$subway = new Factory($redis);

$message = new Message('default', 'Subway\Tests\Job\Md5Job', array('hello' => 'world'));
$id = $this->factory->enqueue($message);

echo "Job $id enqueued!";

If you need to enqueue Message only once use enqueueOnce method.

Executing jobs

To execute jobs you can either use the binary file distributed with this library (see bin directory) or download the latest .phar archive from: http://eymengunay.github.io/subway/downloads/subway-latest.phar

Once you have located the binary or downloaded .phar archive start your worker using the following command:

php subway.phar worker

To see all available options and arguments see command help:

php subway.phar worker -h

Commands

command description
clear Clear subway database
help Displays help for a command
init Create a new subway configuration file
list Lists commands
sample Loads sample jobs
self-update Updates subway.phar to the latest version
status Show subway status
worker Starts a subway worker

Reporting an issue or a feature request

Issues and feature requests related to this library are tracked in the Github issue tracker: https://github.com/eymengunay/subway/issues

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固