|
@@ 113-120 (lines=8) @@
|
| 110 |
|
|
| 111 |
|
// check schedule |
| 112 |
|
$messagesString = []; |
| 113 |
|
if ($this->redis instanceof Client) { |
| 114 |
|
$messagesString = $this->redis->zrangebyscore($this->scheduleKey, '-inf', microtime(true), ['LIMIT' => ['OFFSET' => 0, 'COUNT' => 1]]); |
| 115 |
|
if (count($messagesString)) { |
| 116 |
|
foreach ($messagesString as $messageString) { |
| 117 |
|
$this->redis->zrem($this->scheduleKey, $messageString); |
| 118 |
|
} |
| 119 |
|
} |
| 120 |
|
} |
| 121 |
|
if ($this->redis instanceof Redis) { |
| 122 |
|
$messagesString = $this->redis->zRangeByScore($this->scheduleKey, '-inf', (string)microtime(true), ['limit' => [0, 1]]); |
| 123 |
|
if (count($messagesString)) { |
|
@@ 121-128 (lines=8) @@
|
| 118 |
|
} |
| 119 |
|
} |
| 120 |
|
} |
| 121 |
|
if ($this->redis instanceof Redis) { |
| 122 |
|
$messagesString = $this->redis->zRangeByScore($this->scheduleKey, '-inf', (string)microtime(true), ['limit' => [0, 1]]); |
| 123 |
|
if (count($messagesString)) { |
| 124 |
|
foreach ($messagesString as $messageString) { |
| 125 |
|
$this->redis->zRem($this->scheduleKey, $messageString); |
| 126 |
|
} |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
if (count($messagesString)) { |
| 130 |
|
foreach ($messagesString as $messageString) { |
| 131 |
|
$this->send($this->serializer->unserialize($messageString)); |