1
0
mirror of https://github.com/danog/file.git synced 2024-11-29 20:09:10 +01:00
file/test/ParallelHandleTest.php

24 lines
452 B
PHP
Raw Normal View History

<?php
2016-08-30 21:05:14 +02:00
namespace Amp\File\Test;
use Amp\File;
use Amp\Loop;
2016-08-30 21:05:14 +02:00
use Amp\Parallel\Worker\DefaultPool;
use function Amp\call;
2016-08-30 21:05:14 +02:00
class ParallelHandleTest extends AsyncHandleTest
{
protected function execute(callable $cb)
{
2017-06-17 23:41:57 +02:00
Loop::run(function () use ($cb) {
$pool = new DefaultPool;
File\filesystem(new File\ParallelDriver($pool));
yield call($cb);
yield $pool->shutdown();
2016-08-30 21:05:14 +02:00
});
}
}