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