This library provides a capability for invoke functions asynchronously in PHP. It's based on pure PHP thus you do not need any other libraries or extensions.
Just put php-async.php file in your source code!!
require_once "php-async.php"
use \saman\core;
runtime::callAsync(function() {
// Run async
});
require_once "php-async.php"
use \saman\core;
$param1 = '';
$param2 = '';
runtime::callAsync(function() use ($param1, $param2) {
// You can use $param1 and $param2 here
});
require_once "php-async.php"
use \saman\core;
runtime::callAsync(function() {
// Run async
})->done(function($output) {
// After successful run
})->exception(function(Exception $ex) {
// When any exceptions raised
});
The MIT License (MIT). Please see License File for more information.