locking - Is Redis' set command an atomic operation? -
i'm trying use redis' set command implement simplest distributed lock component, can't find exact basis atomicity through official document, redis' set key value [ex seconds] [px milliseconds] [nx|xx] command atomic operation?
yes. core single threaded, nothing run until set has completed; makes set {key} {value} ex {expiry} nx ideal simple locking.
Comments
Post a Comment