PHPackages                             stephanschuler/fork-job-runner - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. stephanschuler/fork-job-runner

ActiveLibrary[Queues &amp; Workers](/categories/queues)

stephanschuler/fork-job-runner
==============================

1.0.1(3y ago)02.3kMITPHPPHP ^7.2

Since May 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/stephanschuler/fork-job-runner)[ Packagist](https://packagist.org/packages/stephanschuler/fork-job-runner)[ RSS](/packages/stephanschuler-fork-job-runner/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (6)Used By (0)

Fork Job Runner
===============

[](#fork-job-runner)

Creating child processes is expensive, especially when this comes with bootstrapping huge parts of a framework.

This package constantly holds a single PHP process at a certain bootstrap level and forks this process whenever a job is to be executed.

All the demo code blow is to be implemented by the project, it is not provided by this package.

This package does not aim for parallel processing. This might work but other libraries or frameworks like e.g. ReactPHP are way better suited for this.

The primary objective is providing a technical basis for message queues in functional tests. There is specifically the Flowpack Jobqueue Common package shipping a Fake Queue where this package is meant to help providing a replacement.

Jobs
----

[](#jobs)

Every code that should be run in a separate process is called a `Job`. Jobs are created by the parent, serialized, passed to the worker child and unserialized prior to execution. This needs to be considered, especially when dealing with database connections, file pointers and other resources.

```
