Hi Itamar,
Thanks for your prompt reply, however I am not sure it's addressing what I need.
The reason is that I have multiple jobs running conteporarily and when I will reach the LPOP I am not sure the value I am popping is still referring to that identified by the LRANGE.
Indeed in this case, I might have multiple jobs getting the same value from LRANGE and when it comes to LPOP only one of them will pop accordingly, while the others not.
Below you will find my python code.
Now, imagine that a scheduler run such piece of code continuosly on multiple nodes, that means I can have multiple jobs running conteporarily.
The code below works without issue, however what happens if for some reason I have a glitch soon after the blpop???
My data structure is no longer consistent!!!
That's why I am trying to understand how to run such piece of code in a multi /exec
However, if I have the blpop inside a multi / exec, I wouldn't know the result of the pop until the EXEC is completed.
Additionally, the LMOVE / RPOPLPUSH wouldn't allow me to make me any actions in the middle.
Thanks for your time gents
===
user = r.blpop(["Q_active_users"])[1]
if not r.sismember("S_users_to_delete", user):
# ...
# doing something here
# ...
r.rpush("Q_active_users", user)
continue
p = r.pipeline()
p.multi()
# ...
# doing something here
# ...
p.srem("S_users_to_delete", user)
p.execute()