Skip to content

Commit e38f00c

Browse files
Nenad Stojanovikjsagikazarmark
authored andcommitted
Fix BC break in react http (#33)
* Require react/http-client to be ~0.5.9 * Replace $loop->tick() with similar hack * Require event-loop to be 0.5 || 1.0 * Update dependencies * Add react/stream explicit dep
1 parent 57f3696 commit e38f00c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"require": {
1414
"php": "^5.5 || ^7.0",
1515
"php-http/httplug": "^1.0",
16-
"react/http-client": "^0.4.8 || ^0.5",
17-
"react/dns": "^0.4.1",
18-
"react/socket": "^0.8",
16+
"react/http-client": "~0.5.9",
17+
"react/dns": "^0.4.15",
18+
"react/socket": "^1.0",
19+
"react/stream": "^1.0",
20+
"react/event-loop": "^1.0",
1921
"php-http/discovery": "^1.0"
2022
},
2123
"require-dev": {

src/Promise.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,12 @@ public function getState()
175175
*/
176176
public function wait($unwrap = true)
177177
{
178+
$loop = $this->loop;
178179
while (HttpPromise::PENDING === $this->getState()) {
179-
$this->loop->tick();
180+
$loop->futureTick(function () use ($loop) {
181+
$loop->stop();
182+
});
183+
$loop->run();
180184
}
181185

182186
if ($unwrap) {

0 commit comments

Comments
 (0)