2016-12-30 03:59:59 +01:00
|
|
|
<?php
|
2016-08-30 21:05:14 +02:00
|
|
|
|
|
|
|
namespace Amp\File\Test;
|
|
|
|
|
2017-05-18 17:31:20 +02:00
|
|
|
use Amp\File;
|
2017-05-18 05:59:17 +02:00
|
|
|
use Amp\Loop;
|
2016-08-30 21:05:14 +02:00
|
|
|
use Amp\Parallel\Worker\DefaultPool;
|
2017-05-18 17:31:20 +02:00
|
|
|
use function Amp\call;
|
2016-08-30 21:05:14 +02:00
|
|
|
|
|
|
|
class ParallelHandleTest extends HandleTest {
|
2017-05-18 17:31:20 +02:00
|
|
|
protected function lRun(callable $cb) {
|
|
|
|
Loop::run(function() use ($cb) {
|
|
|
|
$pool = new DefaultPool;
|
|
|
|
$pool->start();
|
2017-05-18 05:59:17 +02:00
|
|
|
|
2017-05-18 17:31:20 +02:00
|
|
|
File\filesystem(new File\ParallelDriver($pool));
|
|
|
|
yield call($cb);
|
2017-05-18 05:59:17 +02:00
|
|
|
|
2017-05-18 17:31:20 +02:00
|
|
|
yield $pool->shutdown();
|
2016-08-30 21:05:14 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|