I'd like to perform an atomic GET
in Redis, and if the value returned is equal to some expected value, I'd like to do a SET
, but I want to chain all of this together as one atomic operation. (I'm trying to set a flag that indicates whether any process is writing data to disk, as only one process may be permitted to do so.)
Is it possible to accomplish this with Redis?
I have seen documentation on MULTI
operations but I haven't seen conditional operations i MULTI
operations. Any suggestions others can offer with this would be greatly appreciated!