-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathRun.php
More file actions
53 lines (48 loc) · 1.65 KB
/
Run.php
File metadata and controls
53 lines (48 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
declare(strict_types=1);
/**
* Copyright (c) 2022 Kai Sassnowski
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @see https://github.com/roach-php/roach
*/
namespace RoachPHP\Core;
use RoachPHP\Downloader\Downloader;
use RoachPHP\Downloader\DownloaderMiddlewareInterface;
use RoachPHP\Extensions\ExtensionInterface;
use RoachPHP\Http\Request;
use RoachPHP\ItemPipeline\ItemPipelineInterface;
use RoachPHP\ItemPipeline\Processors\ItemProcessorInterface;
use RoachPHP\Spider\Processor;
use RoachPHP\Spider\SpiderMiddlewareInterface;
/**
* @psalm-immutable
*/
final class Run
{
/**
* @param Request[] $startRequests
* @param DownloaderMiddlewareInterface[] $downloaderMiddleware
* @param ItemProcessorInterface[] $itemProcessors
* @param SpiderMiddlewareInterface[] $responseMiddleware
* @param ExtensionInterface[] $extensions
* @param null|Downloader $downloader
* @param null|ItemPipelineInterface $itemPipeline
* @param null|Processor $responseProcessor
*/
public function __construct(
public array $startRequests,
public array $downloaderMiddleware = [],
public array $itemProcessors = [],
public array $responseMiddleware = [],
public array $extensions = [],
public int $concurrency = 25,
public int $requestDelay = 0,
public ?Downloader $downloader = null,
public ?ItemPipelineInterface $itemPipeline = null,
public ?Processor $responseProcessor = null,
) {
}
}