|
15 | 15 | use Dogma\Http\HttpRequest;
|
16 | 16 | use Dogma\NonCloneableMixin;
|
17 | 17 | use Dogma\NonSerializableMixin;
|
| 18 | +use Dogma\Obj; |
18 | 19 | use Dogma\StrictBehaviorMixin;
|
19 | 20 | use Dogma\Time\Provider\CurrentTimeProvider;
|
20 | 21 | use const CURLM_CALL_MULTI_PERFORM;
|
@@ -50,7 +51,7 @@ class HttpChannelManager
|
50 | 51 | /** @var HttpChannel[] */
|
51 | 52 | private $channels = [];
|
52 | 53 |
|
53 |
| - /** @var mixed[] ($resourceId => array($channelId, $jobName, $request)) */ |
| 54 | + /** @var mixed[] (int $resourceId => array($channelId, $jobName, $request)) */ |
54 | 55 | private $resources = [];
|
55 | 56 |
|
56 | 57 | /** @var HttpHeaderParser|null */
|
@@ -154,7 +155,7 @@ public function exec(): int
|
154 | 155 | private function readResults(): void
|
155 | 156 | {
|
156 | 157 | while ($info = curl_multi_info_read($this->handler)) {
|
157 |
| - $resourceId = (string) $info['handle']; |
| 158 | + $resourceId = Obj::objectId($info['handle']); |
158 | 159 | [$channelId, $name, $request] = $this->resources[$resourceId];
|
159 | 160 | $channel = &$this->channels[$channelId];
|
160 | 161 |
|
@@ -218,7 +219,7 @@ private function selectChannel()
|
218 | 219 | */
|
219 | 220 | public function jobStarted($resource, HttpChannel $channel, $name, HttpRequest $request): void
|
220 | 221 | {
|
221 |
| - $this->resources[(string) $resource] = [spl_object_hash($channel), $name, $request]; |
| 222 | + $this->resources[Obj::objectId($resource)] = [spl_object_hash($channel), $name, $request]; |
222 | 223 | }
|
223 | 224 |
|
224 | 225 | public function getHeaderParser(): HttpHeaderParser
|
|
0 commit comments