mondrian_redis_segment_cache 0.0.7-java → 0.0.8-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/mondrian_redis_segment_cache/cache.rb +27 -1
- data/lib/mondrian_redis_segment_cache/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52fc884f08cb6511123868a3d379072014b951ca
|
4
|
+
data.tar.gz: f41e83e0fcb83d3eea5093c3ee1ff3914fe4db76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4184cbb636e36387a05137b443c5e9881fba0ebd727405b6fe566b1dc861de1167bd2816621d736e9334f4690428fa5797fbb54d10cde98ada5bfa5813b1f57
|
7
|
+
data.tar.gz: ec614f690401554c0df63f95b0b5fc05825ade5dd1fd5281f718f03c99bb44616e7c7d261c1cf6ad91633d2138eb68756978ed90fe76945e58161774209d06c9
|
data/README.md
CHANGED
@@ -51,7 +51,7 @@ In Redis we use the notifications api, so you must turn it on!
|
|
51
51
|
It is off by default because it is a new feature and can be CPU intensive. Redis does a ton, so there is a minimum of notifications
|
52
52
|
that must be turned on for this gem to work.
|
53
53
|
|
54
|
-
`notify-keyspace-events
|
54
|
+
`notify-keyspace-events Egex$`
|
55
55
|
|
56
56
|
This tells Redis to publish keyevent events (which means we can subscribe to things like set/del) and to publish the generic commands
|
57
57
|
(like DEL, EXPIRE) and finally String commands (like SET)
|
@@ -50,7 +50,15 @@ module MondrianRedisSegmentCache
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def deleted_event_key
|
53
|
-
@
|
53
|
+
@deleted_event_key ||= "__keyevent@#{client_options[:db]}__:del"
|
54
|
+
end
|
55
|
+
|
56
|
+
def evicted_event_key
|
57
|
+
@evicted_event_key ||= "__keyevent@#{client_options[:db]}__:evicted"
|
58
|
+
end
|
59
|
+
|
60
|
+
def expired_event_key
|
61
|
+
@expired_event_key ||= "__keyevent@#{client_options[:db]}__:expired"
|
54
62
|
end
|
55
63
|
|
56
64
|
def eager_load_listener(listener)
|
@@ -122,6 +130,8 @@ module MondrianRedisSegmentCache
|
|
122
130
|
mondrian_redis.srem(SEGMENT_HEADERS_SET_KEY, message)
|
123
131
|
end
|
124
132
|
end
|
133
|
+
alias_method :publish_evicted_to_listeners, :publish_deleted_to_listeners
|
134
|
+
alias_method :publish_expired_to_listeners, :publish_deleted_to_listeners
|
125
135
|
|
126
136
|
def put(segment_header, segment_body)
|
127
137
|
segment_header.description # Hazel adapter says this affects serialization
|
@@ -219,6 +229,22 @@ module MondrianRedisSegmentCache
|
|
219
229
|
end
|
220
230
|
end
|
221
231
|
|
232
|
+
Thread.new(expired_listener_connection, self) do |expired_redis_connection, mondrian_cache|
|
233
|
+
expired_redis_connection.subscribe(mondrian_cache.expired_event_key) do |on|
|
234
|
+
on.message do |channel, message|
|
235
|
+
mondrian_cache.publish_expired_to_listeners(message)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
Thread.new(evicted_listener_connection, self) do |evicted_redis_connection, mondrian_cache|
|
241
|
+
evicted_redis_connection.subscribe(mondrian_cache.evicted_event_key) do |on|
|
242
|
+
on.message do |channel, message|
|
243
|
+
mondrian_cache.publish_evicted_to_listeners(message)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
222
248
|
@listeners_registered = true
|
223
249
|
end
|
224
250
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mondrian_redis_segment_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|