soft_evict_cache 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soft_evict_cache/single_value_cache.rb +8 -3
- data/lib/soft_evict_cache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd45cbbcd3207ffa787cc059433d689527c8ab54
|
4
|
+
data.tar.gz: ef8204a7a066cc3cb92fef4932c703706af4ea17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1739db7c966a4ab3fd80d7127e3f695b5cd60e179c756c0fab57d7c6ec43e1f70e58d48201ad98518eb43407a87303adf1280346774bf21ddf8ee1f182b58d32
|
7
|
+
data.tar.gz: f21352abc2a190e42d32de7b28521e6b6650492f6bb46869210405f302dec6a4528d0de2c423fb62a37e8dd2fa10033446c4261c99fcbdccd3fb3230e1096600
|
@@ -37,9 +37,14 @@ module SoftEvictCache
|
|
37
37
|
else
|
38
38
|
promise = Concurrent::Promise.new
|
39
39
|
@agent.send do |old_entry|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
begin
|
41
|
+
new_entry = update_entry(old_entry)
|
42
|
+
promise.set(new_entry.value)
|
43
|
+
new_entry
|
44
|
+
rescue Exception => e
|
45
|
+
promise.fail(e)
|
46
|
+
raise e
|
47
|
+
end
|
43
48
|
end
|
44
49
|
promise.value
|
45
50
|
end
|