C++ Server-Side SDK
LaunchDarkly SDK
Typedefs | Functions
big_segments_builder.h File Reference
#include <launchdarkly/bindings/c/export.h>
#include <stddef.h>
Include dependency graph for big_segments_builder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct _LDServerBigSegmentsBuilder * LDServerBigSegmentsBuilder
 
typedef struct _LDServerBigSegmentStorePtr * LDServerBigSegmentStorePtr
 

Functions

 LDServerBigSegmentsBuilder_New (LDServerBigSegmentStorePtr store)
 
 LDServerBigSegmentsBuilder_ContextCacheSize (LDServerBigSegmentsBuilder b, size_t size)
 
 LDServerBigSegmentsBuilder_ContextCacheTimeMs (LDServerBigSegmentsBuilder b, unsigned int milliseconds)
 
 LDServerBigSegmentsBuilder_StatusPollIntervalMs (LDServerBigSegmentsBuilder b, unsigned int milliseconds)
 
 LDServerBigSegmentsBuilder_StaleAfterMs (LDServerBigSegmentsBuilder b, unsigned int milliseconds)
 
 LDServerBigSegmentsBuilder_Free (LDServerBigSegmentsBuilder b)
 

Typedef Documentation

◆ LDServerBigSegmentStorePtr

typedef struct _LDServerBigSegmentStorePtr* LDServerBigSegmentStorePtr

Opaque handle to a Big Segment store implementation, produced by an integration library (for example, the server-side Redis or DynamoDB Big Segments source libraries).

Behavior is undefined if the pointer does not originate from a LaunchDarkly-provided Big Segments integration.

Function Documentation

◆ LDServerBigSegmentsBuilder_ContextCacheSize()

LDServerBigSegmentsBuilder_ContextCacheSize ( LDServerBigSegmentsBuilder  b,
size_t  size 
)

Sets the maximum number of context membership lookups cached by the SDK. Defaults to 1000.

A higher value reduces store queries for recently-referenced contexts at the cost of memory.

Parameters
bBig Segments builder. Must not be NULL.
sizeMaximum cached lookups.

◆ LDServerBigSegmentsBuilder_ContextCacheTimeMs()

LDServerBigSegmentsBuilder_ContextCacheTimeMs ( LDServerBigSegmentsBuilder  b,
unsigned int  milliseconds 
)

Sets the time-to-live for cached membership lookups. Defaults to 5 seconds.

A higher value reduces store queries for any given context, but delays the SDK noticing membership changes. Zero is coerced to the default.

Parameters
bBig Segments builder. Must not be NULL.
millisecondsCache time-to-live.

◆ LDServerBigSegmentsBuilder_Free()

LDServerBigSegmentsBuilder_Free ( LDServerBigSegmentsBuilder  b)

Frees a Big Segments builder. Do not call if the builder was consumed by the config builder.

Parameters
bBuilder to free.

◆ LDServerBigSegmentsBuilder_New()

LDServerBigSegmentsBuilder_New ( LDServerBigSegmentStorePtr  store)

Creates a Big Segments builder wrapping the given store.

The store pointer is consumed: the SDK takes ownership of the underlying store and will free it when the SDK is destroyed. Do not free the store pointer after calling this function.

If not passed into the config builder, the returned Big Segments builder must be manually freed with LDServerBigSegmentsBuilder_Free.

Parameters
storeBig Segment store handle. Must not be NULL.
Returns
A new Big Segments builder.

◆ LDServerBigSegmentsBuilder_StaleAfterMs()

LDServerBigSegmentsBuilder_StaleAfterMs ( LDServerBigSegmentsBuilder  b,
unsigned int  milliseconds 
)

Sets how long the SDK waits before treating store data as stale. Defaults to 2 minutes.

If the store's last-updated timestamp falls behind the current time by more than this duration, evaluations report a big segments status of STALE and the status provider reports the store as stale. Zero is coerced to the default.

Parameters
bBig Segments builder. Must not be NULL.
millisecondsStaleness threshold.

◆ LDServerBigSegmentsBuilder_StatusPollIntervalMs()

LDServerBigSegmentsBuilder_StatusPollIntervalMs ( LDServerBigSegmentsBuilder  b,
unsigned int  milliseconds 
)

Sets the interval at which the SDK polls the store's metadata to determine availability and staleness. Defaults to 5 seconds.

Zero is coerced to the default.

Parameters
bBig Segments builder. Must not be NULL.
millisecondsPoll interval.