Made the code more robust.
Extended functionality with helper functions.
This commit is contained in:
14
bin/example/sample.php
Executable file
14
bin/example/sample.php
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/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...
|
||||
Reference in New Issue
Block a user