2017 © Pedro Peláez
 

library symfony-worker-control

Console command for maintaining worker processes

image

nayjest/symfony-worker-control

Console command for maintaining worker processes

  • Friday, October 6, 2017
  • by nayjest
  • Repository
  • 1 Watchers
  • 1 Stars
  • 54 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

PHP Worker Control

Console command for maintaining worker processes., (*1)

Symfony Worker Control may be used as standalone script or included as lib to existing project., (*2)

Dependencies

  • php5+ | php7+ | hhvm
  • symfony/console 3+ package
  • pgrep & pkill command-line utilities

Installation

Installation as lib to existing project:, (*3)

composer require nayjest/symfony-worker-control, (*4)

Installation as standalone script:, (*5)

git clone https://github.com/Nayjest/symfony-worker-control.git && cd symfony-worker-control && composer install && chmod +x workers, (*6)

Testing

Code-style (PSR2):, (*7)

1) Install code sniffer:, (*8)

composer global require "squizlabs/php_codesniffer=*", (*9)

2) Run code-style tests from symfony-worker-control folder, (*10)

composer cs, (*11)

Worker for tests:, (*12)

tests/example-worker.php, (*13)

Usage

workers [--qty QTY] [-o|--output OUTPUT] [-e|--errors ERRORS] [--] <action> <cmd>, (*14)

Command may be executed directly (./workers ...) or as argument of php command (php workers ...)., (*15)

See ./workers --help for help., (*16)

Actions

start -- start QTY processes, (*17)

restart -- stop all processes and then start QTY processes, (*18)

stop -- stop all processes, (*19)

maintain -- start QTY - N processes, where N — quantity of currently running processes., (*20)

count -- print count of running processes, (*21)

list -- print information about running processes, (*22)

Options

--qty=<value> — specifies quantity of processes to start/restart/maintain If value isn't specified, DEFAULT_WORKER_QTY environment variable will be used. if DEFAULT_WORKER_QTY isn't defined, qty = 1, (*23)

--output=<value> -o <value> output file for workers (STDOUT + STDERR if --errors not specified), following placeholder: {i} will be replaced to process number. Default value: /dev/null, (*24)

--errors=<value> -e <value> output file for workers (STDERR), following placeholder: {i} will be replaced to process number., (*25)

--quiet -q Do not output any message, (*26)

Help: ./workers --help, (*27)

Examples:, (*28)

./workers start --qty=2 "php my_process.php", (*29)

./workers restart --qty=3 "my_process.php", (*30)

php workers maintain --qty=4 "php my_process.php", (*31)

php workers stop "php my_process.php", (*32)

Security

If you discover any security related issues, please email mail@vitaliy.in instead of using the issue tracker., (*33)

License

© 2017—2018 Vitalii Stepanenko, (*34)

Licensed under the MIT License., (*35)

Please see License File for more information., (*36)

The Versions

06/10 2017

dev-debian7support

dev-debian7support

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

04/10 2017

dev-master

9999999-dev

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

04/10 2017

v1.2.0

1.2.0.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

02/10 2017

dev-add_base_tests

dev-add_base_tests

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

02/10 2017

v1.1.2

1.1.2.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

28/09 2017

v1.1.1

1.1.1.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

28/09 2017

v1.1.0

1.1.0.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

27/09 2017

v1.0.2

1.0.2.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

27/09 2017

v1.0.1

1.0.1.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko

27/09 2017

v1.0.0

1.0.0.0

Console command for maintaining worker processes

  Sources   Download

MIT

The Requires

 

by v.stepanenko