Method: Redis#setnx
- Defined in:
- lib/redis.rb
#setnx(key, value) ⇒ Object
Set the value of a key, only if the key does not exist.
672 673 674 675 676 |
# File 'lib/redis.rb', line 672 def setnx(key, value) synchronize do _bool @client.call [:setnx, key, value] end end |