sinevia/php-library-sqldb-tasks 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sinevia/php-library-sqldb-tasks

Composer 安装命令:

composer require sinevia/php-library-sqldb-tasks

包简介

PHP SqlDb Tasks

README 文档

README

Persistent task queue for SqlDb.

Build status GitHub stars HitCount

Features

  • Asynchronious (multiple threads/processes) or synchronious (sigle thread/process) execution
  • Instantant (by the code creating the task) or queued for execution by another process
  • Full details logged
  • Inspectable, debuggable
  • Re-runnable

How it works?

  • Tasks. Tasks are defined in the task table. Each task defines a handler class. The handler class has a method handle($parameters), which processes teh task and returns true on success, false otherwise.

  • Queue. The tasks to be processed are added to the queued table with its parameters. Each task is then sequentially processed, by calling the handle methdod of its handler which also receives the parameters. Depending on the result the queued task is marked as completed on success, failed otherwise.

Quick Example

$task = \Sinevia\Tasks\Task::queue('\App\Tasks\PaypalOrderTask', $parametersArray);

if ($task == null){
    logger()->error('Task "\App\Tasks\PaypalOrderTask" failed to be created', $parametersArray);
    return false;
}

$result = \Sinevia\Tasks\Queue::processQueuedTaskById($task->get('Id'));
return $result;

Task Handlers

class HelloWorldTask extends \Sinevia\Tasks\BaseHandler {
    function handle(array $parameters){
        $this->queuedTask->addDetails('Adding Hello World to Output Parameters');
        
        $this->queuedTask->setOutputKey('hello','world');
        
        return true;
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-06-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固