Skip to content
Jason M edited this page Jun 8, 2017 · 2 revisions

Synopsis

The PHP Daemon library allows you to easily create stable, robust and long running PHP processes with minimal boilerplate code. Parallel background Tasks and Workers run independently and can be called with a single line of code. The setup, maintenance and cleanup of these background processes are handled automatically by the ProcessManager plugin. The list below shows the steps needed to make the minimal daemon possible (w/o any custom configuration, plugins, tasks or workers).

  1. Extend the core Daemon class. For example: class MyDaemon extends Daemon {}
  2. Implement the abstract method execute(), which is called every loop cycle (1 second by default)
  3. Get the daemon instance and call run: MyDaemon::getInstance()->run() (Daemon is a singleton)

Learn

  • Quick Start Guide - All users should start here
  • Logging - Simple logging mechanism, including automatic log rotation detection
  • Signal Handling - Intercept signals from the Operating System
  • Events - Intercept various events during the Daemon life cycle
  • Plugins - extend the daemon using reusable and shareable code
  • Stats - Automatic daemon stats
  • Tasks - light weight, single run and forget processes
  • Workers - The workhorse of your daemon

to be continued...

Clone this wiki locally