C++ Server-Side SDK
LaunchDarkly SDK
|
Go to the source code of this file.
Typedefs | |
typedef struct _LDServerLazyLoadBuilder * | LDServerLazyLoadBuilder |
typedef struct _LDServerLazyLoadSourcePtr * | LDServerLazyLoadSourcePtr |
Enumerations | |
enum | LDLazyLoadCacheEvictionPolicy { LD_LAZYLOAD_CACHE_EVICTION_POLICY_DISABLED = 0 } |
Specifies the action taken when a data item within the in-memory cache expires. More... | |
Functions | |
LDServerLazyLoadBuilder_New () | |
LDServerLazyLoadBuilder_Free (LDServerLazyLoadBuilder b) | |
Frees the memory associated with a Lazy Load builder. Do not call if the builder was consumed by the SDK config builder. | |
LDServerLazyLoadBuilder_SourcePtr (LDServerLazyLoadBuilder b, LDServerLazyLoadSourcePtr source) | |
LDServerLazyLoadBuilder_CacheRefreshMs (LDServerLazyLoadBuilder b, unsigned int milliseconds) | |
Specify the duration data items should live in-memory before requiring a refresh via the database. The chosen LDLazyLoadCacheEvictionPolicy affects usage of this TTL. | |
LDServerLazyLoadBuilder_CachePolicy (LDServerLazyLoadBuilder b, enum LDLazyLoadCacheEvictionPolicy policy) | |
Specify the eviction policy when a data item's TTL expires. At this time, only LD_LAZYLOAD_CACHE_EVICTION_POLICY_DISABLED is supported (the default), which leaves stale items in the cache until they can be refreshed. | |
Specifies the action taken when a data item within the in-memory cache expires.
At this time, the default policy is the only supported policy so there is no need to explicitely set it.
LDServerLazyLoadBuilder_CachePolicy | ( | LDServerLazyLoadBuilder | b, |
enum LDLazyLoadCacheEvictionPolicy | policy | ||
) |
Specify the eviction policy when a data item's TTL expires. At this time, only LD_LAZYLOAD_CACHE_EVICTION_POLICY_DISABLED is supported (the default), which leaves stale items in the cache until they can be refreshed.
b | The builder. Must not be NULL. |
policy | The eviction policy. |
LDServerLazyLoadBuilder_CacheRefreshMs | ( | LDServerLazyLoadBuilder | b, |
unsigned int | milliseconds | ||
) |
Specify the duration data items should live in-memory before requiring a refresh via the database. The chosen LDLazyLoadCacheEvictionPolicy affects usage of this TTL.
b | The builder. Must not be NULL. |
milliseconds | The time-to-live for an item in milliseconds. |
LDServerLazyLoadBuilder_Free | ( | LDServerLazyLoadBuilder | b | ) |
Frees the memory associated with a Lazy Load builder. Do not call if the builder was consumed by the SDK config builder.
b | The builder to free. |
LDServerLazyLoadBuilder_New | ( | ) |
Creates a Lazy Load builder which can be used as the SDK's data system.
In Lazy Load mode, the SDK will query a source for data as required, with an in-memory cache to reduce the number of queries. This enables usage of databases for storing feature flag/segment data.
In contrast, the Background Sync system injects data into the SDK asynchronously (either instantly as updates happen, in streaming mode; or periodically, in polling mode).
Background Sync mode is preferred for most use cases, but Lazy Load may be beneficial when no connection to LaunchDarkly is required, such as when using the Relay Proxy to populate a database.
LDServerLazyLoadBuilder_SourcePtr | ( | LDServerLazyLoadBuilder | b, |
LDServerLazyLoadSourcePtr | source | ||
) |
Configures the Lazy Load system with a source via opaque pointer to C++ ISerializedDataReader.
b | The builder. Must not be NULL. |
source | The source pointer. Behavior is undefined if the pointer is not an ISerializedDataReader. Must not be NULL. |