Made the code more robust.
Extended functionality with helper functions.
This commit is contained in:
1 parent
1466c2eaef
commit
c0cfaadcc3
8 files changed
+372
-93
No files matched your search
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
use function Joop\Asynchronous\async;
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$promise = async(function () {
|
||||
sleep(1);
|
||||
|
||||
return range(random_int(0, 10), random_int(20, 60));
|
||||
});
|
||||
|
||||
$array = $promise->resolve()->getValue();
|
||||
var_dump($array);
|
||||
Reference in new issue
Block a user