1 | <?php |
||
16 | class ReactAwareCurlFactory implements CurlFactoryInterface |
||
17 | { |
||
18 | private $eventLoop; |
||
19 | private $logger; |
||
20 | private $factory; |
||
21 | private $count; |
||
22 | private $handler; |
||
23 | |||
24 | /** @var TimerInterface */ |
||
25 | private $timer; |
||
26 | |||
27 | public function __construct(LoopInterface $eventLoop, LoggerInterface $logger = null) |
||
35 | |||
36 | public function setHandler(CurlMultiHandler $handler) |
||
40 | |||
41 | public function tick() |
||
49 | |||
50 | /** |
||
51 | * Creates a cURL handle resource. |
||
52 | * |
||
53 | * @param RequestInterface $request Request |
||
54 | * @param array $options Transfer options |
||
55 | * |
||
56 | * @return EasyHandle |
||
57 | * @throws \RuntimeException when an option cannot be applied |
||
58 | */ |
||
59 | public function create(RequestInterface $request, array $options) |
||
67 | |||
68 | /** |
||
69 | * Release an easy handle, allowing it to be reused or closed. |
||
70 | * |
||
71 | * This function must call unset on the easy handle's "handle" property. |
||
72 | * |
||
73 | * @param EasyHandle $easy |
||
74 | */ |
||
75 | public function release(EasyHandle $easy) |
||
81 | |||
82 | private function incrementCount() |
||
90 | |||
91 | private function decrementCount() |
||
95 | |||
96 | private function startTimer() |
||
104 | |||
105 | private function stopTimer() |
||
114 | } |