codeigniter-redis icon indicating copy to clipboard operation
codeigniter-redis copied to clipboard

multi & exec hmget failed

Open eranhazout opened this issue 11 years ago • 5 comments

Hi again. When using multi & exec with hmget function, every third request receive a correct response. Checked without multi and it works... Any idea?

$this->redis->multi(); $this->redis->hmget('member.123',array('profile')); $this->redis->hmget('member.234',array('profile')); $this->redis->hmget('member.345',array('profile')); $this->redis->hmget('member.456',array('profile')); var_dump($this->redis->exec());

array(970) { [0]=> string(1) "$" [1]=> bool(false) [2]=> string(189) "GOOD RESPONSE" [3]=> string(1) "$" }

Thanks!

eranhazout avatar Oct 13 '14 00:10 eranhazout

This may be related to #53 and #57...

danhunsaker avatar Oct 22 '14 09:10 danhunsaker

Hi Eran, I'm sorry you're having trouble with the library. The multi command was added after the library was released and I've never actually tested its functionality (or the lack thereof..) using this library. I'll hopefully get around to fixing this over the weekend, but I can't make any promises.

joelcox avatar Oct 23 '14 06:10 joelcox

No problem Joel. Thank you!

eranhazout avatar Oct 23 '14 10:10 eranhazout

Well, I did some research today and had a first stab at supporting multi array responses, but the infamous issues @danhunsaker linked to keep me from implementing a workable solution..

https://github.com/joelcox/codeigniter-redis/commit/1ab6c5fd5fcaa632f819d85785cfaf8663248d76#diff-7f450e802fd9c037f134eafcd5ad6119R284

joelcox avatar Oct 25 '14 17:10 joelcox

I also tried to fix it but didn't succeed to get multi array responses.. finally I wrote an autoloader for codeigniter and predis which is work well. Thank you for your effort.

eranhazout avatar Oct 26 '14 12:10 eranhazout