tomislavcivcija / parallel

A succinct parallel concurrency API for PHP8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parallel

Linux AddressSanitizer Windows Coverage Status

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).

About

A succinct parallel concurrency API for PHP8

License:Other


Languages

Language:C 77.2%Language:PHP 20.9%Language:M4 0.9%Language:Dockerfile 0.6%Language:Shell 0.3%