Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

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

Code of conduct

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages