Skip to content

GrandMasterX/php-multithreading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Multithreading class for php 5.3+

Multithreading class for php 5.3+

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist grandmasterx/yii2-multithreading "*"

or add

"grandmasterx/yii2-multithreading": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

$threads = new Threads;
$threads->newThread(dirname(__FILE__).'/file.php', array());
while (false !== ($result = $threads->iteration())) {
    if (!empty($result)) {
        echo $result."\r\n";
    }
}
echo (date("H:i:s"));
$end = microtime(true);
echo "Execution time ".round($end - $start, 2)."\r\n";
die;

About

multithreading for php

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages