Skip to content

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.

License

Notifications You must be signed in to change notification settings

rghale/php-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asynchronous Function Call in PHP

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.

Installation

Just put php-async.php file in your source code!!

Usage

require_once "php-async.php"
use \saman\core;

runtime::callAsync(function() {
  // Run async 
});

Pass parameters

require_once "php-async.php"
use \saman\core;

$param1 = '';
$param2 = '';

runtime::callAsync(function() use ($param1, $param2) {
  // You can use $param1 and $param2 here 
});

Event listeners

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
});

License

The MIT License (MIT). Please see License File for more information.

About

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.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages