Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duncan3dc/fork-helper
A PHP helper to fork processes and allow multi-threading
https://github.com/duncan3dc/fork-helper
fork multi-threading php
Last synced: 4 days ago
JSON representation
A PHP helper to fork processes and allow multi-threading
- Host: GitHub
- URL: https://github.com/duncan3dc/fork-helper
- Owner: duncan3dc
- License: apache-2.0
- Created: 2014-06-04T18:57:51.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T15:08:44.000Z (4 months ago)
- Last Synced: 2024-10-01T21:38:27.676Z (about 1 month ago)
- Topics: fork, multi-threading, php
- Language: PHP
- Homepage:
- Size: 911 KB
- Stars: 72
- Watchers: 9
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
fork-helper
===========Simple class to fork processes in PHP and allow multi-threading.
Full documentation is available at https://duncan3dc.github.io/fork-helper/
PHPDoc API documentation is also available at [https://duncan3dc.github.io/fork-helper/api/](https://duncan3dc.github.io/fork-helper/api/namespaces/duncan3dc.Forker.html)[![release](https://poser.pugx.org/duncan3dc/fork-helper/version.svg)](https://packagist.org/packages/duncan3dc/fork-helper)
[![build](https://github.com/duncan3dc/fork-helper/workflows/buildcheck/badge.svg?branch=main)](https://github.com/duncan3dc/fork-helper/actions?query=branch%3Amain+workflow%3Abuildcheck)
[![coverage](https://codecov.io/gh/duncan3dc/fork-helper/graph/badge.svg)](https://codecov.io/gh/duncan3dc/fork-helper)Quick Example
-------------Run some code asynchronously:
```php
$fork = new \duncan3dc\Forker\Fork;$fork->call(function () {
for ($i = 1; $i <= 3; $i++) {
echo "Process A - " . $i . "\n";
sleep(1);
}
});
$fork->call(function () {
for ($i = 1; $i < 3; $i++) {
echo "Process B - " . $i . "\n";
sleep(1);
}
});sleep(1);
echo "Waiting for the threads to finish...\n";
$fork->wait();
echo "End\n";
```_Read more at https://duncan3dc.github.io/fork-helper/_
Changelog
---------
A [Changelog](CHANGELOG.md) has been available since version 2.0.0Where to get help
-----------------
Found a bug? Got a question? Just not sure how something works?
Please [create an issue](https//github.com/duncan3dc/fork-helper/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)## duncan3dc/fork-helper for enterprise
Available as part of the Tidelift Subscription
The maintainers of duncan3dc/fork-helper and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-fork-helper?utm_source=packagist-duncan3dc-fork-helper&utm_medium=referral&utm_campaign=readme)