C++ Server-Side SDK
LaunchDarkly SDK
|
LazyLoadBuilder allows for specifying the configuration of the Lazy Load data system, which is appropriate when a LaunchDarkly environment should be stored external to the SDK (such as in Redis.) More...
#include <lazy_load_builder.hpp>
Public Types | |
using | SourcePtr = std::shared_ptr< integrations::ISerializedDataReader > |
using | EvictionPolicy = built::LazyLoadConfig::EvictionPolicy |
Public Member Functions | |
LazyLoadBuilder () | |
Constructs a new LazyLoadBuilder. | |
LazyLoadBuilder & | Source (SourcePtr source) |
Specify the source of the data. More... | |
LazyLoadBuilder & | CacheRefresh (std::chrono::milliseconds ttl) |
Specify the duration data items should live in-memory before requiring a refresh via the database. The chosen EvictionPolicy affects usage of this TTL. More... | |
LazyLoadBuilder & | CacheEviction (EvictionPolicy policy) |
Specify the eviction policy when a data item's TTL expires. At this time, only EvictionPolicy::Disabled is supported (the default), which leaves stale items in the cache until they can be refreshed. More... | |
tl::expected< built::LazyLoadConfig, Error > | Build () const |
LazyLoadBuilder allows for specifying the configuration of the Lazy Load data system, which is appropriate when a LaunchDarkly environment should be stored external to the SDK (such as in Redis.)
In the Lazy Load system, flag and segment data is fetched on-demand from the database and stored in an in-memory cache for a specific duration. This allows the SDK to maintain a working set of data that may be a specific subset of the entire environment.
The database is read-only from the perspective of the SDK. To populate the database with flag and segment data, an external process (e.g. Relay Proxy or another SDK) is necessary.
LazyLoadBuilder & launchdarkly::server_side::config::builders::LazyLoadBuilder::CacheEviction | ( | EvictionPolicy | policy | ) |
Specify the eviction policy when a data item's TTL expires. At this time, only EvictionPolicy::Disabled is supported (the default), which leaves stale items in the cache until they can be refreshed.
policy | The EvictionPolicy. |
LazyLoadBuilder & launchdarkly::server_side::config::builders::LazyLoadBuilder::CacheRefresh | ( | std::chrono::milliseconds | ttl | ) |
Specify the duration data items should live in-memory before requiring a refresh via the database. The chosen EvictionPolicy affects usage of this TTL.
ttl | The time-to-live for an item. |
LazyLoadBuilder & launchdarkly::server_side::config::builders::LazyLoadBuilder::Source | ( | SourcePtr | source | ) |
Specify the source of the data.
source | Component implementing ISerializedDataReader. Ownership is shared. |