Module: Cache::DalliClient

Defined in:
lib/cache/dalli_client.rb

Instance Method Summary collapse

Instance Method Details

#_cas(k, ttl, &blk) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/cache/dalli_client.rb', line 30

def _cas(k, ttl, &blk)
  if _valid_ttl?(ttl)
    @metal.cas k, ttl, &blk
  else
    @metal.cas k, &blk
  end
end

#_delete(k) ⇒ Object



38
39
40
# File 'lib/cache/dalli_client.rb', line 38

def _delete(k)
  @metal.delete k
end

#_exist?(k) ⇒ Boolean

sux

Returns:

  • (Boolean)


47
48
49
# File 'lib/cache/dalli_client.rb', line 47

def _exist?(k)
  !@metal.get(k).nil?
end

#_fetch(k, ttl, &blk) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/cache/dalli_client.rb', line 22

def _fetch(k, ttl, &blk)
  if _valid_ttl?(ttl)
    @metal.fetch k, ttl, &blk
  else
    @metal.fetch k, &blk
  end
end

#_flushObject



42
43
44
# File 'lib/cache/dalli_client.rb', line 42

def _flush
  @metal.flush
end

#_get(k) ⇒ Object



6
7
8
# File 'lib/cache/dalli_client.rb', line 6

def _get(k)
  @metal.get k
end

#_get_multi(ks) ⇒ Object



10
11
12
# File 'lib/cache/dalli_client.rb', line 10

def _get_multi(ks)
  @metal.get_multi ks
end

#_set(k, v, ttl) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/cache/dalli_client.rb', line 14

def _set(k, v, ttl)
  if _valid_ttl?(ttl)
    @metal.set k, v, ttl
  else
    @metal.set k, v
  end
end

#_statsObject



51
52
53
# File 'lib/cache/dalli_client.rb', line 51

def _stats
  @metal.stats
end

#after_forkObject



2
3
4
# File 'lib/cache/dalli_client.rb', line 2

def after_fork
  @metal.close
end