2016-12-29 20:59:59 -06:00
|
|
|
<?php
|
2016-08-30 14:05:14 -05:00
|
|
|
|
2020-06-30 21:45:09 +02:00
|
|
|
namespace Amp\File\Test\Driver;
|
2016-08-30 14:05:14 -05:00
|
|
|
|
2017-05-18 10:31:20 -05:00
|
|
|
use Amp\File;
|
2020-06-30 21:45:09 +02:00
|
|
|
use Amp\File\Driver\ParallelDriver;
|
|
|
|
use Amp\File\Test\DriverTest;
|
2016-08-30 14:05:14 -05:00
|
|
|
use Amp\Parallel\Worker\DefaultPool;
|
2019-08-23 13:59:26 -05:00
|
|
|
use Amp\Parallel\Worker\Pool;
|
2016-08-30 14:05:14 -05:00
|
|
|
|
2018-10-27 10:57:31 -05:00
|
|
|
class ParallelDriverTest extends DriverTest
|
|
|
|
{
|
2020-10-08 09:23:44 -05:00
|
|
|
private Pool $pool;
|
2017-05-17 22:59:17 -05:00
|
|
|
|
2020-06-30 21:45:09 +02:00
|
|
|
protected function createDriver(): File\Driver
|
2019-08-23 13:59:26 -05:00
|
|
|
{
|
|
|
|
$this->pool = new DefaultPool;
|
2020-06-30 21:45:09 +02:00
|
|
|
|
|
|
|
return new ParallelDriver($this->pool);
|
2019-08-23 13:59:26 -05:00
|
|
|
}
|
2017-05-17 22:59:17 -05:00
|
|
|
|
2020-06-30 21:45:09 +02:00
|
|
|
protected function tearDownAsync(): void
|
2019-08-23 13:59:26 -05:00
|
|
|
{
|
|
|
|
$this->pool->shutdown();
|
2016-08-30 14:05:14 -05:00
|
|
|
}
|
|
|
|
}
|