PHP code example of async-interop / promise-test
1. Go to this page and download the library: Download async-interop/promise-test library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
async-interop / promise-test example snippets
class MyDriverTest extends \Interop\Async\Promise\Test {
function getFactory() {
return new MyDriverFactory;
}
function getPromise() {
$resolver = new MyPromiseResolver;
return [
$resolver->promise(),
function($v) use ($resolver) { $resolver->succeed($v); },
function($e) use ($resolver) { $resolver->fail($e); },
];
}
}