2016-12-29 20:59:59 -06:00
|
|
|
<?php
|
2016-08-30 14:05:14 -05:00
|
|
|
|
|
|
|
namespace Amp\File\Test;
|
|
|
|
|
2017-05-18 10:31:20 -05:00
|
|
|
use Amp\File;
|
2017-05-17 22:59:17 -05:00
|
|
|
use Amp\Loop;
|
2016-08-30 14:05:14 -05:00
|
|
|
use Amp\Parallel\Worker\DefaultPool;
|
2017-05-18 10:31:20 -05:00
|
|
|
use function Amp\call;
|
2016-08-30 14:05:14 -05:00
|
|
|
|
|
|
|
class ParallelDriverTest extends DriverTest {
|
2017-06-16 18:12:42 -05:00
|
|
|
protected function execute(callable $cb) {
|
2017-06-17 23:41:57 +02:00
|
|
|
Loop::run(function () use ($cb) {
|
2017-05-18 10:31:20 -05:00
|
|
|
$pool = new DefaultPool;
|
2017-05-17 22:59:17 -05:00
|
|
|
|
2017-05-18 10:31:20 -05:00
|
|
|
File\filesystem(new File\ParallelDriver($pool));
|
|
|
|
yield call($cb);
|
2017-05-17 22:59:17 -05:00
|
|
|
|
2017-05-18 10:31:20 -05:00
|
|
|
yield $pool->shutdown();
|
2016-08-30 14:05:14 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|