Module: LaunchDarkly::Interfaces::BigSegmentStoreStatusProvider

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

Overview

An interface for querying the status of a Big Segment store.

The Big Segment store is the component that receives information about Big Segments, normally from a database populated by the LaunchDarkly Relay Proxy. Big Segments are a specific type of segments. For more information, read the LaunchDarkly documentation: https://docs.launchdarkly.com/home/users/big-segments

An implementation of this interface is returned by LDClient#big_segment_store_status_provider. Application code never needs to implement this interface.

There are two ways to interact with the status. One is to simply get the current status; if its available property is true, then the SDK is able to evaluate context membership in Big Segments, and the stale` property indicates whether the data might be out of date.

The other way is to subscribe to status change notifications. Applications may wish to know if there is an outage in the Big Segment store, or if it has become stale (the Relay Proxy has stopped updating it with new data), since then flag evaluations that reference a Big Segment might return incorrect values. To allow finding out about status changes as soon as possible, BigSegmentStoreStatusProvider mixes in Ruby's Observable module to provide standard methods such as add_observer. Observers will be called with a new BigSegmentStoreStatus value whenever the status changes.

Examples:

Getting the current status

status = client.big_segment_store_status_provider.status

Subscribing to status notifications

client.big_segment_store_status_provider.add_observer(self, :big_segments_status_changed)

def big_segments_status_changed(new_status)
  puts "Big segment store status is now: #{new_status}"
end

Instance Method Summary collapse

Instance Method Details

#statusBigSegmentStoreStatus

Gets the current status of the store, if known.

Returns:

  • (BigSegmentStoreStatus)

    the status, or nil if the SDK has not yet queried the Big Segment store status



562
563
# File 'lib/ldclient-rb/interfaces.rb', line 562

def status
end