Home > Article > Backend Development > PHP extension PHPredis gets data and returns data similar to :1
As mentioned, the project uses the list
queue of redis
. When using rpop
to obtain data, sometimes a value similar to :1
will be returned; the transmission was found in the issues
list of phpredis
on github
Gate, the version used by the project is version 2.2.7
. Is there any solution to similar problems?
As mentioned, the project uses the list
queue of redis
. When using rpop
to obtain data, sometimes a value similar to :1
will be returned; the transmission was found in the issues
list of phpredis
on github
Gate, the version used by the project is version 2.2.7
. Is there any solution to similar problems?
Upload the code
<code>while (true) { $list = $redis->blpop(DXKey::getKeyOfRunnerEmailTaskListPending(), 6); if (is_array($list) && count($list) == 2) { DXUtil::consoleLog(DXUtil::jsonEncode($list)); $payload = $list[1]; DXUtil::consoleLog('pop: ' . $payload); $task = @json_decode($payload, true); MailTaskRunner::runEmailTask($task); } }</code>
Execution results
<code>2016-11-23 19:23:07 start 2016-11-23 19:23:08 ["runner.email.task.list.pending","{\"time\":1479900188,\"type\":1,\"data\":{\"to_address\":\"wqcsimple@foxmail.com\",\"task_id\":1}}"] 2016-11-23 19:23:08 pop: {"time":1479900188,"type":1,"data":{"to_address":"wqcsimple@foxmail.com","task_id":1}} 2016-11-23 19:23:08 send success </code>