定制 tvup/redis-job-inspector 二次开发

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

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

tvup/redis-job-inspector

最新稳定版本:v1.0.0

Composer 安装命令:

composer require tvup/redis-job-inspector

包简介

Inspect Laravel Redis queue jobs like Eloquent

README 文档

README

Inspect Laravel Redis queue jobs using an Eloquent-like query builder.

Packagist Version License

Installation

Install via Composer:

composer require tvup/redis-job-inspector

This package requires PHP 8.1+ and supports Laravel 10 and 11. Laravel's package auto-discovery will register the service provider and facade.

Usage

Use the RedisQueue facade to build and execute queries against your Redis queues:

use RedisQueue;

// All scheduled and running jobs on the default queue
$jobs = RedisQueue::jobs()->get();

// Scheduled jobs on the "emails" queue
$scheduled = RedisQueue::jobs()
    ->inQueue('emails')
    ->withJobState('Scheduled')
    ->get();

// Jobs of a specific class
$jobsOfClass = RedisQueue::jobs()
    ->withJobClass(\App\Jobs\SendEmail::class)
    ->get();

// Custom filters (e.g., displayName LIKE "%SendEmail%")
$filtered = RedisQueue::jobs()
    ->where('displayName', 'like', '%SendEmail%')
    ->where('job_state', '=', 'Running')
    ->get();

Query Builder Methods

  • inQueue(string $queue): Specify the queue name (default: default).
  • withJobState(string $state): Filter by job state (Scheduled or Running).
  • withJobClass(string $class): Target a specific job class and extract its properties.
  • where(string $field, string $operator, mixed $value): Add a field filter (operators: = and like).
  • reset(): Reset filters to defaults.
  • get(): Run the query and return an Illuminate\Support\Collection of jobs.

Each job item in the result collection includes:

  • job_state: Scheduled or Running.
  • displayName: Job display name or class name.
  • command: Array of command properties (e.g., delay).
  • delay_to: Timestamp when the job is scheduled to run.
  • pushed_at: Carbon instance of when the job was pushed.
  • attempts: Number of attempts so far.
  • max_tries: Maximum retries allowed.
  • Any public/protected/private properties of the job class when using withJobClass().

Support & Contributing

If you encounter any issues or have questions, please open an issue on the GitHub repository.

Contributions are welcome! Please submit a pull request.

License

The MIT License (MIT). See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-03