pecl / parallel
A succinct parallel concurrency API for PHP 8
Fund package maintenance!
krakjoe
gofund.me/c34f3dde
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1 499
Watchers: 58
Forks: 96
Open Issues: 9
Language:C
Type:php-ext
Requires
- php: >= 8.0.0
This package is not auto-updated.
Last update: 2024-12-14 07:30:34 UTC
README
A succinct parallel concurrency API for PHP 8
Documentation
Documentation can be found in the PHP manual: https://php.net/parallel
Requirements and Installation
See INSTALL.md
Hello World
<?php $runtime = new \parallel\Runtime(); $future = $runtime->run(function(){ for ($i = 0; $i < 500; $i++) echo "*"; return "easy"; }); for ($i = 0; $i < 500; $i++) { echo "."; } printf("\nUsing \\parallel\\Runtime is %s\n", $future->value());
This may output something like (output abbreviated):
.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*
Using \parallel\Runtime is easy
Development
See CONTRIBUTING.md for guidelines on contribution and development (and debugging).