定制 rafaeltovar/laravel-job-trackable 二次开发

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

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

rafaeltovar/laravel-job-trackable

Composer 安装命令:

composer require rafaeltovar/laravel-job-trackable

包简介

Laravel job tracked in Redis.

README 文档

README

Track Laravel Jobs, saving status, inputs, outputs and date times during a week in Redis.

Based on imTigger/laravel-job-status.

Jobs tracks is saved during a week in Redis. This time can be setted in config file.

Installation

Composer

composer require rafaeltovar/laravel-job-trackable

Features

  • Job status
  • Date time of queue, execute, update and finished
  • Number of retries
  • Redis persist / NoSQL database
  • Controller for manage Tracks
  • Simple and light
  • Cli commands

Instructions

Step 1. Include Service Provider into providers section in config/app.php.

'providers' => [
  //...
  LaravelJobTrackable\Providers\LaravelJobTrackableServiceProvider::class,
];

Step 2. Add trait to our Laravel Job and init track with track method. Step 3.* Use setOutput method for save final Job output.

<?php
namespace App\Jobs;

use LaravelJobTrackable\Jobs\TrackableJob;

class TrackedJob extends Job
{
    use TrackableJob;

    public function __construct($input1, $input2) {
        // track the job-execution
        $this->track(['input1' => $input1, 'input2' => $input2]); // inputs are optionals
    }

    public function handle()
    {
        // Do something...
        $this->setOutput(['output1' => $output1]); // optional
    }
}

Using Controller

If you need use the controller for get jobs can you use it.

$ctrl = app(\LaravelJobTrackable\TrackedJobController::class);

try {
    $track = $ctrl->get($idJobTrack);

    // Do something...
} catch (\Exception $e) { // not found
    // Do something...
}

Object TrackedJob

The object LaravelJobTrackable\TrackedJob have the following public methods: // TODO

Method Allowed values
getStatus() : string
setStatus(string) : self
setOutput(array)
getOutput(): array
getQueuedAt() ?\Carbon\Carbon

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固