php-async/bin/example/sample.php
Joop Schilder c0cfaadcc3 Made the code more robust.
Extended functionality with helper functions.
2019-01-16 16:22:02 +01:00

14 lines
219 B
PHP
Executable File

#!/usr/bin/php
<?php
use function Joop\Asynchronous\async;
require_once __DIR__ . '/../../vendor/autoload.php';
$process = function ($number) {
sleep($number);
return $number;
};
async($process, 2);
// Do stuff...