Lines Matching refs:this

41         $this->factory = isset($options['handle_factory'])
45 $this->selectTimeout = $options['select_timeout'];
47 $this->selectTimeout = $selectTimeout;
49 $this->selectTimeout = 1;
52 $this->options = isset($options['options']) ? $options['options'] : [];
58 $this->_mh = curl_multi_init();
60 foreach ($this->options as $option => $value) {
62 curl_multi_setopt($this->_mh, $option, $value);
67 return $this->_mh;
75 if (isset($this->_mh)) {
76 curl_multi_close($this->_mh);
77 unset($this->_mh);
83 $easy = $this->factory->create($request, $options);
87 [$this, 'execute'],
89 return $this->cancel($id);
93 $this->addRequest(['easy' => $easy, 'deferred' => $promise]);
104 if ($this->delays) {
106 foreach ($this->delays as $id => $delay) {
108 unset($this->delays[$id]);
110 $this->_mh,
111 $this->handles[$id]['easy']->handle
120 if ($this->active &&
121 curl_multi_select($this->_mh, $this->selectTimeout) === -1
128 while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
130 $this->processMessages();
140 while ($this->handles || !$queue->isEmpty()) {
142 if (!$this->active && $this->delays) {
143 usleep($this->timeToNext());
145 $this->tick();
153 $this->handles[$id] = $entry;
155 curl_multi_add_handle($this->_mh, $easy->handle);
157 $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000);
171 if (!isset($this->handles[$id])) {
175 $handle = $this->handles[$id]['easy']->handle;
176 unset($this->delays[$id], $this->handles[$id]);
177 curl_multi_remove_handle($this->_mh, $handle);
185 while ($done = curl_multi_info_read($this->_mh)) {
187 curl_multi_remove_handle($this->_mh, $done['handle']);
189 if (!isset($this->handles[$id])) {
194 $entry = $this->handles[$id];
195 unset($this->handles[$id], $this->delays[$id]);
199 $this,
201 $this->factory
211 foreach ($this->delays as $time) {