imper86 / supervisor-bundle

用于创建/更新supervisor配置和控制supervisor进程的Symfony扩展包

安装: 46

依赖: 0

建议者: 0

安全性: 0

星标: 2

关注者: 1

分支: 1

开放问题: 0

类型:symfony-bundle

v2.2.1 2020-02-13 15:48 UTC

This package is auto-updated.

Last update: 2024-09-14 02:30:12 UTC


README

Symfony扩展包,用于创建/更新supervisor配置和控制supervisor进程。

此扩展包深受phobetor/rabbitmq-supervisor-bundle的启发。

安装

使用composer安装

composer require imper86/supervisor-bundle

将扩展包添加到你的bundles.php文件中

Imper86\SupervisorBundle\Imper86SupervisorBundle::class => ['all' => true]

配置

要开始使用此扩展包,你必须配置你的supervisor "实例"。实例是由一起控制的命令组。

因此,如果你想要某些命令单独启动/停止等,可以通过使用另一个实例来实现。

示例配置

imper86_supervisor:
    # you can define workspace dir for bundle, this is default:
    workspace_directory: '%kernel.project_dir%/var/imper86supervisor/%kernel.environment%'

    # to start using bundle you must configure your instances and worker commands
    instances:
        default:
            commands:
                messenger:
                    command: 'messenger:consume async_high async_low --limit=50'
                    numprocs: 1
                messenger_multiproc:
                    command: 'messenger:consume async_multiproc --limit=50'
                    numprocs: 4
                crawler:
                    command: 'app:crawl'
                    numprocs: 1
        enqueue:
            commands:
                enqueue:
                    command: 'enqueue:consume --message-limit=10'
                    numprocs: 4
        foo_instance:
            commands:
                foo:
                    command: 'app:foo'
                bar:
                    command: 'app:bar'

控制台命令

  • i86:supervisor:rebuild - 此命令将
    • 停止正在运行的工人
    • 使用你的配置创建配置文件
    • 询问你是否想要启动工人
  • i86:supervisor:control - 使用此命令并带参数
    • stop - 停止正在运行的工人
    • status - 获取supervisor的当前状态
    • start/restart - 使用当前配置启动工人
  • i86:supervisor:clean:dirs - 删除工作空间中未配置的所有目录
  • i86:supervisor:clean:logs - 删除与扩展包相关的所有.log文件

贡献

任何帮助都将非常感激 :)