Method: Xunch::ListObjectCache#putex

Defined in:
lib/xunch/cache/list_object_cache.rb

#putex(key, values, ttl) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/xunch/cache/list_object_cache.rb', line 35

def putex(key, values, ttl)
  raise "key can not be nil." unless key != nil
  raise "values can not be nil." unless values != nil
  sub_keys = []
  values.each { | value |
    raise "value in values can not be nil." unless value != nil
    sub_keys.push(@delegate.getCacheObjectKey(value))
  }
  temp_key = assembleTempKey(key)
  new_key = assembleKey(key)
  @delegate.multi_putex(values,ttl)
  @shard_redis.lset(temp_key,new_key,sub_keys,ttl)
end