descom/laravel-supervisor-queue

Laravel 包用于 supervisor queue:work

v0.0.1 2022-06-07 06:48 UTC

This package is auto-updated.

Last update: 2024-09-04 21:26:41 UTC


README

tests analyse style

创建此包的动机是允许在共享主机环境中工作与队列。

安装

compoer require descom/laravel-supervisor-queue

配置

php artisan vendor:publish --provider="Descom\Supervisor\SupervisorServiceProvider" --tag="config"

这是发布配置文件的目录内容

<?php

return [
    'workers' => [
        'default' => [
            'options' => [
                // 'sleep' => 3,
                // 'tries' => 3,
                // 'max-time' => 3600,
            ],

            // 'connection' => 'database',

            // 'enabled' => false,
        ],

        // 'other_worker' => [
        //     'options' => [max-time' => 3600],
        //     'connection' => 'sqs',
        // ],
    ],

    'schedule' => [

        'start' => [
            'enabled' => true,

            // 'cron' => '* * * * *',
        ],

    ],
];

用法

php artisan supervisor:status
php artisan supervisor:start
php artisan supervisor:stop
php artisan supervisor:restart
use Descom\Supervisor\Service;

Service::status();
Service::start();
Service::stop();
Service::restart();