soneritics / pcntl
PCNTL helper methods
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/soneritics/pcntl
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: dev-master
- squizlabs/php_codesniffer: dev-master
This package is auto-updated.
Last update: 2025-09-23 20:07:45 UTC
README
by
- @Soneritics - Jordi Jolink
Introduction
Helper method for working with forks.
Minimum Requirements
- PHP 7.1
Features
- tbd
- tbd
Example
The following PHP code is a minimal example of one of the possibilities of this library.
(new \PCNTL\ThreadStart)->startAndWait( (new \PCNTL\ThreadCollection) ->add(new ExampleClass('Test 1')) ->add(new ExampleClass('Test 2')) ->add(new ExampleClass('Test 3')) ->add(new ExampleClass('Test 4')) ->add(new ExampleClass('Test 5')) );
Running multiple threads (forks), output will look like:
Starting
Starting Test 1
Starting Test 2
Starting Test 3
Starting Test 5
Starting Test 4
Ended Test 1
Ended Test 3
Ended Test 5
Ended Test 2
Ended Test 4
Program is done.