2017 © Pedro Peláez
 

library libdaemon

image

tectiv3/libdaemon

  • Monday, August 22, 2016
  • by tectiv3
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yet another PHP daemon lib

Create and run php daemon with custom workers, (*1)

Installation

Installation, (*2)

composer require tectiv3/libdaemon, (*3)

Define workers and run your daemon

Define workers, (*4)

use Daemon\Worker;

class ExampleWorker extends Worker {
    function run_cycle() {
        echo "I'm a work horse!\n";
    }
}

Create config, (*5)

[default]
    logfile = "daemon.log"
    pidfile = "daemon.pid"
    daemonize = true
    worker_class = "ExampleWorker"
    max_children = 2

Run daemon, (*6)

    $master = new Master('config.ini', 3600); //restart workers every hour
    $master->start();

Examples

Examples can be found in the examples/ folder, (*7)

The Versions

22/08 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar tectiv3

php pcntl daemon fork