Module: LruRedux::Util::SafeSync

Includes:
MonitorMixin
Included in:
TTL::ThreadSafeCache, ThreadSafeCache
Defined in:
lib/lru_redux/util/safe_sync.rb,
lib/lru_redux/util/safe_sync_jruby.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



36
37
38
39
40
# File 'lib/lru_redux/util/safe_sync.rb', line 36

def [](key)
  synchronize do
    super(key)
  end
end

#[]=(key, value) ⇒ Object



42
43
44
45
46
# File 'lib/lru_redux/util/safe_sync.rb', line 42

def []=(key, value)
  synchronize do
    super(key, value)
  end
end

#clearObject



84
85
86
87
88
# File 'lib/lru_redux/util/safe_sync.rb', line 84

def clear
  synchronize do
    super
  end
end

#countObject



90
91
92
93
94
# File 'lib/lru_redux/util/safe_sync.rb', line 90

def count
  synchronize do
    super
  end
end

#delete(key) ⇒ Object



60
61
62
63
64
# File 'lib/lru_redux/util/safe_sync.rb', line 60

def delete(key)
  synchronize do
    super(key)
  end
end

#eachObject



48
49
50
51
52
# File 'lib/lru_redux/util/safe_sync.rb', line 48

def each
  synchronize do
    super
  end
end

#evict(key) ⇒ Object



66
67
68
69
70
# File 'lib/lru_redux/util/safe_sync.rb', line 66

def evict(key)
  synchronize do
    super(key)
  end
end

#fetch(key, &block) ⇒ Object



30
31
32
33
34
# File 'lib/lru_redux/util/safe_sync.rb', line 30

def fetch(key)
  synchronize do
    super(key)
  end
end

#getset(key, &block) ⇒ Object



24
25
26
27
28
# File 'lib/lru_redux/util/safe_sync.rb', line 24

def getset(key)
  synchronize do
    super(key)
  end
end

#has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
81
82
# File 'lib/lru_redux/util/safe_sync.rb', line 78

def has_key?(key)
  synchronize do
    super(key)
  end
end

#initialize(*args) ⇒ Object



8
9
10
# File 'lib/lru_redux/util/safe_sync.rb', line 8

def initialize(*args)
  super(*args)
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
75
76
# File 'lib/lru_redux/util/safe_sync.rb', line 72

def key?(key)
  synchronize do
    super(key)
  end
end

#max_size=(max_size) ⇒ Object



12
13
14
15
16
# File 'lib/lru_redux/util/safe_sync.rb', line 12

def max_size=(max_size)
  synchronize do
    super(max_size)
  end
end

#to_aObject



54
55
56
57
58
# File 'lib/lru_redux/util/safe_sync.rb', line 54

def to_a
  synchronize do
    super
  end
end

#ttl=(ttl) ⇒ Object



18
19
20
21
22
# File 'lib/lru_redux/util/safe_sync.rb', line 18

def ttl=(ttl)
  synchronize do
    super(ttl)
  end
end

#valid?Boolean

Returns:

  • (Boolean)


96
97
98
99
100
# File 'lib/lru_redux/util/safe_sync.rb', line 96

def valid?
  synchronize do
    super
  end
end