Method: Redis#setex

Defined in:
lib/redis.rb

#setex(key, ttl, value) ⇒ Object

Set the time to live in seconds of a key.

Parameters:

  • key (String)
  • ttl (Fixnum)
  • value (String)


689
690
691
692
693
# File 'lib/redis.rb', line 689

def setex(key, ttl, value)
  synchronize do |client|
    client.call([:setex, key, ttl, value.to_s])
  end
end