定制 99designs/sera 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

99designs/sera

最新稳定版本:v1.1.1

Composer 安装命令:

composer require 99designs/sera

包简介

Asynchronous task execution library

README 文档

README

Allows for long-running or asynchronous tasks to be written as Tasks and queued on a variety on queuing mechanism.

Currently supports Beanstalk and Amazon SQS.

Build Status

Installation

To add sera to a project, the easiest way is via composer:

{
    "require": {
        "99designs/sera": ">=1.0.0"
    }
}

Usage

<?php

// a simple task
class MyTask extends Sera_Task_Abstract
{
	public static function create($params)
	{
		return new self($params);
	}

	public function execute()
	{
    my_long_running_function($this->_data);
	}
}

// a queue that connects to beanstalkd
$queue = new Sera_Queue_BeanstalkQueue("127.0.0.1");
$queue->select('llama_tasks');

// enqueue the task
$queue->enqueue(MyTask::create('some data'));

// normally this would be in a seperate process
$worker = new Sera_Queue_QueueWorker($queue);
$worker->execute();

Copyright

Copyright (c) 2012 99designs See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2012-12-13