mirror of
https://github.com/danog/file.git
synced 2024-12-12 09:19:48 +01:00
24 lines
452 B
PHP
24 lines
452 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 AsyncHandleTest
|
|
{
|
|
protected function execute(callable $cb)
|
|
{
|
|
Loop::run(function () use ($cb) {
|
|
$pool = new DefaultPool;
|
|
|
|
File\filesystem(new File\ParallelDriver($pool));
|
|
yield call($cb);
|
|
|
|
yield $pool->shutdown();
|
|
});
|
|
}
|
|
}
|