PHPackages                             smskin/laravel-daemon-supervisor - 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. smskin/laravel-daemon-supervisor

ActiveLibrary

smskin/laravel-daemon-supervisor
================================

Daemon supervisor engine for laravel projects

1.0.2(1y ago)01.2k[1 PRs](https://github.com/smskin/laravel-daemon-supervisor/pulls)1MITPHPPHP ^8.1CI passing

Since May 28Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/smskin/laravel-daemon-supervisor)[ Packagist](https://packagist.org/packages/smskin/laravel-daemon-supervisor)[ RSS](/packages/smskin-laravel-daemon-supervisor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (5)Used By (1)

Basic Library for Implementing Child Processes in Laravel
=========================================================

[](#basic-library-for-implementing-child-processes-in-laravel)

The idea for this library originated from studying the source code of [Laravel Horizon](https://laravel.com/docs/11.x/horizon).

Horizon starts a master process that spawns child processes to execute tasks from queues.

How It Works
------------

[](#how-it-works)

We start a master process (`supervisor`), which spawns and manages child processes (`worker`).

The master process is subscribed to [PCNTL](https://www.php.net/manual/ru/intro.pcntl.php) signals. Upon receiving a signal, it first terminates the child processes and then stops itself.

Usage
-----

[](#usage)

### Master Process (supervisor) - CLI

[](#master-process-supervisor---cli)

The artisan command class for the supervisor should extend `SMSkin\LaravelSupervisor\Commands\SupervisorsCommand`.

In the class, you need to implement the method `protected function getWorkers(): Collection`, which returns a collection of worker process models (classes that implement the `SMSkin\LaravelSupervisor\Contracts\IWorker` interface).

You can find an example of an artisan command in `./src/Examples/TestSupervisorCommand.php`.

### Worker Process (worker) - CLI

[](#worker-process-worker---cli)

The artisan command class for the worker should extend `SMSkin\LaravelSupervisor\Commands\WorkerCommand`.

In the class, you need to implement two methods:

- `public function getSubscribedSignals(): array` - an array of PCNTL signals that this process listens for.
- `public function handleSignal(int $signal, false|int $previousExitCode = 0): int|false` - a method called when a PCNTL signal is received.
- You can find an example of an artisan command in `./src/Examples/TestWorkerCommand.php`.

### Worker Process Model

[](#worker-process-model)

The class should implement the `SMSkin\LaravelSupervisor\Contracts\IWorker interface`.

In the class, you need to implement the method `public function getArtisanCommand(): string`, which returns the artisan command corresponding to the worker process.

You can find an example class in `./src/Examples/TestWorker.php`.

Projects that use this library (for extended example):
------------------------------------------------------

[](#projects-that-use-this-library-for-extended-example)

- [smskin/laravel-rabbitmq](https://github.com/smskin/laravel-rabbitmq)
    - [Supervisor command](https://github.com/smskin/laravel-rabbitmq/blob/main/src/Commands/SupervisorCommand.php)
    - [Worker command](https://github.com/smskin/laravel-rabbitmq/blob/main/src/Commands/WorkerCommand.php)
    - [Worker model](https://github.com/smskin/laravel-rabbitmq/blob/main/src/Entities/Worker.php)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance54

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~151 days

Total

3

Last Release

411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92de9daad6e0c4ef7b8b4fa112373401ae79ac02d185653724ca4ac425add1b7?d=identicon)[smskin](/maintainers/smskin)

---

Top Contributors

[![smskin](https://avatars.githubusercontent.com/u/3227797?v=4)](https://github.com/smskin "smskin (14 commits)")

---

Tags

laraveldaemonsupervisormultithread

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smskin-laravel-daemon-supervisor/health.svg)

```
[![Health](https://phpackages.com/badges/smskin-laravel-daemon-supervisor/health.svg)](https://phpackages.com/packages/smskin-laravel-daemon-supervisor)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)

PHPackages © 2026

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