1 | <?php |
||
21 | class NativeRequestExecutor extends AbstractRequestExecutor |
||
22 | { |
||
23 | /** |
||
24 | * Pipeline |
||
25 | * |
||
26 | * @var Pipeline |
||
27 | */ |
||
28 | private $pipeline; |
||
29 | |||
30 | /** |
||
31 | * PipelineFactory |
||
32 | * |
||
33 | * @var PipelineFactory |
||
34 | */ |
||
35 | private $pipelineFactory; |
||
36 | |||
37 | /** |
||
38 | * RequestExecutor constructor. |
||
39 | * |
||
40 | * @param PipelineFactory $pipelineFactory Pipeline factory |
||
41 | * @param Configuration $configuration Configuration for executor |
||
42 | */ |
||
43 | 69 | public function __construct(PipelineFactory $pipelineFactory, Configuration $configuration) |
|
48 | |||
49 | /** {@inheritdoc} */ |
||
50 | 67 | protected function initializeRequest(EventCaller $eventCaller, ExecutionContext $executionContext) |
|
51 | { |
||
52 | 67 | parent::initializeRequest($eventCaller, $executionContext); |
|
53 | 67 | $this->pipeline = $this->pipelineFactory->createPipeline($this, $executionContext, $eventCaller, $this->solver); |
|
54 | 67 | } |
|
55 | |||
56 | /** {@inheritdoc} */ |
||
57 | 67 | protected function terminateRequest(ExecutionContext $executionContext) |
|
58 | 1 | { |
|
59 | 67 | parent::terminateRequest($executionContext); |
|
60 | 67 | $this->pipeline = null; |
|
61 | 67 | } |
|
62 | |||
63 | /** {@inheritdoc} */ |
||
64 | 67 | protected function doExecuteRequest(EventCaller $eventCaller, ExecutionContext $executionContext) |
|
65 | { |
||
66 | 67 | $this->pipeline->process($this->socketBag); |
|
67 | 29 | } |
|
68 | |||
69 | /** {@inheritdoc} */ |
||
70 | 11 | protected function disconnectItems(array $items) |
|
74 | } |
||
75 |