2017 © Pedro Peláez
 

library daemon

Simple Daemon for PHP

image

pnixx/daemon

Simple Daemon for PHP

  • Wednesday, September 7, 2016
  • by PNixx
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Daemon class for PHP

Simple daemon abstract class, (*1)

Requirements

  • PHP 5.6+
  • Composer

Installation

composer require pnixx/daemon

Usage

class Server extends PNixx\Daemon\Daemon {

    public function run() {
        while( !$this->stop ) {
            //working process
        }
    }

    protected function onShutdown() {

    }
}

Example run background:, (*2)

example/run -i /path/to/init.php --log_level debug --quiet

For list all commands, please use --help or -h argument., (*3)

For restart process after deploy use --restart or -r argument. A new process will be waiting finish all running processes., (*4)

See working example on Delayed Job, (*5)

Signals

  • QUIT - Wait finish processing then exit
  • TERM / INT - Immediately kill processes then exit

Author

Sergey Odintsov, @pnixx, (*6)

The Versions

07/09 2016

dev-master

9999999-dev

Simple Daemon for PHP

  Sources   Download

MIT

The Requires

 

php process background daemon

07/09 2016

1.0.1

1.0.1.0

Simple Daemon for PHP

  Sources   Download

MIT

The Requires

 

php process background daemon

06/09 2016

1.0.0

1.0.0.0

Simple Daemon for PHP

  Sources   Download

MIT

The Requires

 

php process background daemon