Class: LaunchDarkly::Impl::Integrations::Redis::RedisBigSegmentStore
Overview
Internal implementation of the Redis big segment store.
Constant Summary
collapse
- KEY_LAST_UP_TO_DATE =
':big_segments_synchronized_on'
- KEY_CONTEXT_INCLUDE =
':big_segment_include:'
- KEY_CONTEXT_EXCLUDE =
':big_segment_exclude:'
Instance Method Summary
collapse
Instance Method Details
#description ⇒ Object
279
280
281
|
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 279
def description
"RedisBigSegmentStore"
end
|
#get_membership(context_hash) ⇒ Object
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 288
def get_membership(context_hash)
with_connection do |redis|
included_refs = redis.smembers(@prefix + KEY_CONTEXT_INCLUDE + context_hash)
excluded_refs = redis.smembers(@prefix + KEY_CONTEXT_EXCLUDE + context_hash)
if !included_refs && !excluded_refs
nil
else
membership = {}
excluded_refs.each { |ref| membership[ref] = false }
included_refs.each { |ref| membership[ref] = true }
membership
end
end
end
|