Method: Xunch::RedisClient#hmset
- Defined in:
- lib/xunch/shard/redis.rb
#hmset(hash, ttl) ⇒ Object
169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/xunch/shard/redis.rb', line 169 def hmset(hash, ttl) with do | redis | redis.pipelined do hash.each { | key, value | redis.mapped_hmset(key, value) if(ttl > 0) redis.expire(key, ttl) end } end end end |