You can actually return anything that is serializable in PHP: objects, arrays, strings, you name it.
```php
<?php
require_once __DIR__ . '/vendor/autoload.php';
$promise = async(function() {
sleep(random_int(1, 5));
return getmypid();
});
// ... some other work
$promise->resolve();
$pid = $promise->getValue();
printf("Me (%d) and %d have worked very hard!\n", getmypid(), $pid);
```
The shutdown handler and destructors should take care of the rest.
### Asynchronous curl requests
... though you should probably look into curl multi handles for this: <ahref="http://php.net/manual/en/function.curl-multi-init.php">curl_multi_init() on PHP.net</a>.