title: Redis: Atomic get and conditional set
body: <p>I'd like to perform an atomic <code>GET</code> in Redis, and if the value returned is equal to some expected value, I'd like to do a <code>SET</code>, 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.)</p>
  
  <p>Is it possible to accomplish this with Redis?</p>
  
  <p>I have seen documentation on <code>MULTI</code> operations but I haven't seen conditional operations i <code>MULTI</code> operations. Any suggestions others can offer with this would be greatly appreciated!</p>