PHPackages                             rgen3/php-process-watcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rgen3/php-process-watcher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rgen3/php-process-watcher
=========================

1326PHP

Since Nov 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/rgen3/php-process-watcher)[ Packagist](https://packagist.org/packages/rgen3/php-process-watcher)[ RSS](/packages/rgen3-php-process-watcher/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-process-watcher
===================

[](#php-process-watcher)

Watches and manages processes in cli

Installation
============

[](#installation)

```
composer require rgen3/php-process-watcher

```

Usage example
-------------

[](#usage-example)

### Create task object

[](#create-task-object)

```
use rgen3\watcher\commands\AbstractProcess;

class Sync extends AbstractProcess
{

    public static $descriptor;

    public function beforeStart()
    {
        echo "Sync is ready to start";
    }

    public function beforeStop()
    {
        // Some actions before process will be killed
        echo "Sync will be stopped";
    }

    // Commnad to be executed
    public static function getCmd(): string
    {
        return '/usr/bin/php -r "while (true) {echo 1; sleep(2);}"';
    }

    // Process descriptor settings
    public static function getDescriptor(): array
    {
        return [
            0 => array("pipe", "r"),
            1 => array("pipe", "w"),
            2 => array("pipe", "a")
        ];
    }

}

```

### How to run watcher

[](#how-to-run-watcher)

```
// Creates watcher instance
$watcher = new \rgen3\watcher\Watcher();

// Add the task to watcher
$watcher->pushProcess(new Sync());

//starts watcher
$watcher->run();

while (true) {
    //some app logic
    sleep(2);

    // Checks if processes is active
    // If down proccess will automatically be restarted
    $watcher->monitor();
}

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2a525168277901e88bf048c7ad50e8ceb8d51655f2422b60455447fd3d9fd2d?d=identicon)[rgen3](/maintainers/rgen3)

---

Top Contributors

[![rgen3](https://avatars.githubusercontent.com/u/5081254?v=4)](https://github.com/rgen3 "rgen3 (10 commits)")

### Embed Badge

![Health badge](/badges/rgen3-php-process-watcher/health.svg)

```
[![Health](https://phpackages.com/badges/rgen3-php-process-watcher/health.svg)](https://phpackages.com/packages/rgen3-php-process-watcher)
```

###  Alternatives

[swissup/module-slick-carousel

the last carousel you'll ever need for magento2

1020.8k1](/packages/swissup-module-slick-carousel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
