15:01:08 GMT anyone here? 15:01:22 GMT i've got a problem with redis 15:01:50 GMT 2 threads concurent access to redis queues 15:02:15 GMT anyone, please? 15:02:32 GMT i don't want to write the whole story any nobody's here to read 15:24:15 GMT PSUser2: redis is single threaded, so no problem on that side 15:24:28 GMT but that not being a problem should be kind of obvious anyway 15:24:41 GMT do you have 2 minutes to explain you what i encounter? 15:24:47 GMT sure thing 15:25:37 GMT (but in the channel please) 15:26:27 GMT while one thread reads an element from a sorted set, and moves it to another key, the other thread reads the same element, but without the score. 15:26:54 GMT i've used multi/exec to read+move the element 15:27:10 GMT but somehow the other thread gets to read the element that is being moved 15:27:59 GMT how do you move it? if that involves having the value client-side it won't help 15:28:23 GMT i move it be recreating it 15:28:35 GMT i've discovered 5 minutes ago this method 15:28:36 GMT smove 15:28:41 GMT maybe this will help 15:29:12 GMT that's for normal sets only 15:30:03 GMT not the ones with score? 15:30:14 GMT not with sorted sets, no 15:30:28 GMT try, it'll probably give you an error 15:30:52 GMT to read+move you currently use zrangebyscore + zadd? 15:30:57 GMT ok, so i move it be reading first the score, then recreating it, then deleting it from the source queue 15:31:09 GMT but i have multi and exec wrapped 15:31:27 GMT that doesn't work if you need the value client-side to do that 15:31:42 GMT smove or rpoplpush-style commands would only work for that 15:32:03 GMT the other option is to do the three commands you have in a lua script. that's atomic and guarantees no other client will get the valyue 15:33:07 GMT rpoplpush, does it return the element with the top score? 15:33:28 GMT that only works for lists, you can't use it on sorted sets either 15:33:34 GMT ah 15:33:54 GMT ok, so lua script. never heard of it. :) i'll check now 15:34:10 GMT see the EVAL command 15:49:53 GMT minus, does this look legit? http://pastebin.com/J63beVwc 15:50:21 GMT you should use the KEYS for keys 15:51:21 GMT PSUser2: ZRANGE has an WITHSCORES argument you can use to get the score in one call 15:51:28 GMT otherwise it looks fine 15:51:54 GMT i don;t know what do you mean by KEYS for keys 15:51:58 GMT actually, zrange returns a list, so you'll have to index into that (index 1, because lua) 15:52:28 GMT you call EVAL with two different types or arguments, ARGV and KEYS, check the docs 15:52:53 GMT ok, but i don't use any keys here 15:53:09 GMT queue_src and queue_dst are keys 15:53:13 GMT i only want it to return to me the top element, and move it to another queue 15:53:16 GMT aaa 15:53:19 GMT my bad 15:53:21 GMT sorry 15:53:28 GMT i'm sorry 15:53:38 GMT it's not strictly necessary, but might cause problems when working with redis cluster i think 15:54:02 GMT if you're using redis 3.2, redis-cli has a lua debugger mode, that might help 15:54:05 GMT if i use zrange with -1 -1, do i still need that index? 15:54:15 GMT (i've never used it, but debugging redis lua scripts otherwise is a pain) 15:54:24 GMT it still returns a list, yes 16:16:31 GMT i've managed to make the lua script to work, thank you minus 16:16:39 GMT you're welcome :) 16:16:40 GMT now i'm trying to integrate it in perl 16:17:01 GMT uh, good luck with that 16:17:56 GMT thank you