Skip to content

Commit f4978a8

Browse files
authored
Merge pull request #1 from iorsa/patch-1
Updates in ConnectionPool in order to use React\Async\await function
2 parents 462c08f + 399d5ce commit f4978a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ConnectionPool.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function get(): ConnectionAdapterInterface
5555
$this->connections->attach($this->makeNewConnection());
5656
return $this->get();
5757
}
58-
return $this->retryWithDelay();
58+
return await($this->retryWithDelay());
5959
}
6060

6161
return $connection;
@@ -76,7 +76,7 @@ protected function makeNewConnection(): ConnectionAdapterInterface
7676
return ($this->connectionFactory)();
7777
}
7878

79-
protected function retryWithDelay(Deferred $deferred = null): ConnectionAdapterInterface
79+
protected function retryWithDelay(Deferred $deferred = null): \React\Promise\Promise
8080
{
8181
if ($this->retryLimit !== null && $this->retryLimit < 1) {
8282
throw new ConnectionPoolException('No available connection to use');
@@ -106,6 +106,6 @@ protected function retryWithDelay(Deferred $deferred = null): ConnectionAdapterI
106106
$this->retryWithDelay($deferred);
107107
});
108108

109-
return await($deferred->promise());
109+
return $deferred->promise();
110110
}
111-
}
111+
}

0 commit comments

Comments
 (0)