Skip to content

fdciabdul/MultiProcess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MultiProcess

Simple Multi Processing In PHP

Install composer require fdciabdul/multiprocess

Example

 $multi = new MultiThread();
    
    $task1 = new Task(call_user_func(function() {
        for ($i = 0; $i < 3; $i++) {
            print "task 1: " . $i . "\n";
            yield;
        }
        // start by executing this
    }));
    
    $task2 = new Task(call_user_func(function() {
        for ($i = 0; $i < 6; $i++) {
            print "task 2: " . $i . "\n";
            yield;
        }
        // then start this one
    }));
    
    $multi->enqueue($task1);
    $multi->enqueue($task2);
    
    $multi->run();

About

Simple Multi Processing In PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages