1
0
mirror of https://github.com/danog/file.git synced 2024-11-30 04:19:39 +01:00
file/test/ParallelHandleTest.php
2017-06-16 18:12:42 -05:00

23 lines
470 B
PHP

<?php
namespace Amp\File\Test;
use Amp\File;
use Amp\Loop;
use Amp\Parallel\Worker\DefaultPool;
use function Amp\call;
class ParallelHandleTest extends HandleTest {
protected function execute(callable $cb) {
Loop::run(function() use ($cb) {
$pool = new DefaultPool;
$pool->start();
File\filesystem(new File\ParallelDriver($pool));
yield call($cb);
yield $pool->shutdown();
});
}
}