Module: LaunchDarkly::Interfaces::BigSegmentStore

Defined in:
lib/ldclient-rb/interfaces.rb

Instance Method Summary collapse

Instance Method Details

#get_membership(context_hash) ⇒ Hash

Queries the store for a snapshot of the current segment state for a specific context.

The context_hash is a base64-encoded string produced by hashing the context key as defined by the Big Segments specification; the store implementation does not need to know the details of how this is done, because it deals only with already-hashed keys, but the string can be assumed to only contain characters that are valid in base64.

The return value should be either a Hash, or nil if the context is not referenced in any big segments. Each key in the Hash is a “segment reference”, which is how segments are identified in Big Segment data. This string is not identical to the segment key– the SDK will add other information. The store implementation should not be concerned with the format of the string. Each value in the Hash is true if the context is explicitly included in the segment, false if the context is explicitly excluded from the segment– and is not also explicitly included (that is, if both an include and an exclude existed in the data, the include would take precedence). If the context’s status in a particular segment is undefined, there should be no key or value for that segment.

This Hash may be cached by the SDK, so it should not be modified after it is created. It is a snapshot of the segment membership state at one point in time.

Parameters:

  • context_hash (String)

Returns:

  • (Hash)

    true/false values for Big Segments that reference this context



452
453
# File 'lib/ldclient-rb/interfaces.rb', line 452

def get_membership(context_hash)
end

#get_metadataBigSegmentStoreMetadata

Returns information about the overall state of the store. This method will be called only when the SDK needs the latest state, so it should not be cached.



425
426
# File 'lib/ldclient-rb/interfaces.rb', line 425

def 
end

#stopvoid

This method returns an undefined value.

Performs any necessary cleanup to shut down the store when the client is being shut down.



460
461
# File 'lib/ldclient-rb/interfaces.rb', line 460

def stop
end