Skip to content

Commit a0400b6

Browse files
authored
Merge pull request #202 from clue-labs/promise-v3
Optimize Promise v3 API compatibility to avoid hitting autoloader
2 parents c0219cc + 133bafb commit a0400b6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"react/cache": "^1.0 || ^0.6 || ^0.5",
3131
"react/event-loop": "^1.2",
3232
"react/promise": "^3.0 || ^2.7 || ^1.2.1",
33-
"react/promise-timer": "^1.8"
33+
"react/promise-timer": "^1.9"
3434
},
3535
"require-dev": {
3636
"clue/block-react": "^1.2",

src/Query/RetryExecutor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace React\Dns\Query;
44

5-
use React\Promise\CancellablePromiseInterface;
65
use React\Promise\Deferred;
76
use React\Promise\PromiseInterface;
87

@@ -25,7 +24,7 @@ public function query(Query $query)
2524
public function tryQuery(Query $query, $retries)
2625
{
2726
$deferred = new Deferred(function () use (&$promise) {
28-
if ($promise instanceof CancellablePromiseInterface || (!\interface_exists('React\Promise\CancellablePromiseInterface') && \method_exists($promise, 'cancel'))) {
27+
if ($promise instanceof PromiseInterface && \method_exists($promise, 'cancel')) {
2928
$promise->cancel();
3029
}
3130
});

0 commit comments

Comments
 (0)