joelcox / codeigniter-redis

A CodeIgniter library to interact with Redis
MIT License
240 stars 142 forks source link

multi & exec hmget failed #56

Open eranhazout opened 9 years ago

eranhazout commented 9 years ago

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!

danhunsaker commented 9 years ago

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

joelcox commented 9 years ago

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.

eranhazout commented 9 years ago

No problem Joel. Thank you!

joelcox commented 9 years ago

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

eranhazout commented 9 years ago

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.