avolver / parallel

A succinct parallel concurrency API for PHP7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parallel

Build Status Build status Coverage Status

A succinct parallel concurrency API for PHP 7

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

About

A succinct parallel concurrency API for PHP7

License:Other


Languages

Language:C 75.1%Language:PHP 20.5%Language:C++ 3.0%Language:M4 0.7%Language:Objective-C 0.5%Language:Makefile 0.2%