| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function listen($queueID) |
||
| 39 | { |
||
| 40 | global $redis; |
||
| 41 | |||
| 42 | $rQueueID = "redisQ:queueID:$queueID"; |
||
| 43 | |||
| 44 | self::registerListener($rQueueID); |
||
| 45 | |||
| 46 | $pop = $redis->blPop($rQueueID, 10); |
||
| 47 | if (!isset($pop[1])) { |
||
| 48 | return; |
||
| 49 | } |
||
| 50 | |||
| 51 | $objectID = $pop[1]; |
||
| 52 | $object = $redis->get($objectID); |
||
| 53 | |||
| 54 | return unserialize($object); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |
Instead of relying on
globalstate, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state