C++ Server-Side SDK
LaunchDarkly SDK
Public Types | Public Member Functions | List of all members
launchdarkly::server_side::config::builders::LazyLoadBuilder Struct Reference

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.
 
LazyLoadBuilderSource (SourcePtr source)
 Specify the source of the data. More...
 
LazyLoadBuilderCacheRefresh (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...
 
LazyLoadBuilderCacheEviction (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
 

Detailed Description

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.

Member Function Documentation

◆ CacheEviction()

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.

Parameters
policyThe EvictionPolicy.
Returns
Reference to this.

◆ CacheRefresh()

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.

Parameters
ttlThe time-to-live for an item.
Returns
Reference to this.

◆ Source()

LazyLoadBuilder & launchdarkly::server_side::config::builders::LazyLoadBuilder::Source ( SourcePtr  source)

Specify the source of the data.

Parameters
sourceComponent implementing ISerializedDataReader. Ownership is shared.
Returns
Reference to this.

The documentation for this struct was generated from the following files: