Refactoring: Simplify NsqTransport::get
This commit is contained in:
@ -74,16 +74,14 @@ final class NsqTransport implements TransportInterface
|
|||||||
*/
|
*/
|
||||||
public function get(): iterable
|
public function get(): iterable
|
||||||
{
|
{
|
||||||
$message = array_pop($this->messages);
|
if ([] === $this->messages) {
|
||||||
|
|
||||||
if (null === $message) {
|
|
||||||
$this->getConsumer();
|
$this->getConsumer();
|
||||||
|
|
||||||
wait(delay(500));
|
wait(delay(500));
|
||||||
|
|
||||||
$message = array_pop($this->messages);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$message = array_pop($this->messages);
|
||||||
|
|
||||||
if (null === $message) {
|
if (null === $message) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user