Add brackets, update README, refactored naming

This commit is contained in:
2019-12-08 01:10:25 +01:00
parent f29d1a0d7a
commit eef63af0b0
8 changed files with 210 additions and 187 deletions

40
lib/functions.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
use JoopSchilder\Asynchronous\Asynchronous;
use JoopSchilder\Asynchronous\Promise;
if (!function_exists('async')) {
/**
* @param callable $function
* @param mixed ...$parameters
* @return Promise
*/
function async(callable $function, ...$parameters)
{
return Asynchronous::run($function, ...$parameters);
}
}
if (!function_exists('async_cleanup')) {
/**
*
*/
function async_cleanup()
{
Asynchronous::cleanup();
}
}
if (!function_exists('async_wait_all')) {
/**
*
*/
function async_wait_all()
{
Asynchronous::waitForChildren();
}
}