C++ Server-Side SDK Redis Source
Provide SDK data via Redis
Public Member Functions | Static Public Member Functions | List of all members
launchdarkly::server_side::integrations::RedisBigSegmentStore Class Referencefinal

RedisBigSegmentStore is a Big Segments persistent store backed by Redis. More...

#include <redis_big_segment_store.hpp>

Inheritance diagram for launchdarkly::server_side::integrations::RedisBigSegmentStore:
Inheritance graph
[legend]
Collaboration diagram for launchdarkly::server_side::integrations::RedisBigSegmentStore:
Collaboration graph
[legend]

Public Member Functions

GetMembershipResult GetMembership (std::string const &context_hash) const noexcept override
 
GetMetadataResult GetMetadata () const noexcept override
 

Static Public Member Functions

static tl::expected< std::unique_ptr< RedisBigSegmentStore >, std::string > Create (std::string uri, std::string prefix)
 Creates a new RedisBigSegmentStore, or returns an error if construction failed. More...
 

Detailed Description

RedisBigSegmentStore is a Big Segments persistent store backed by Redis.

Call RedisBigSegmentStore::Create to obtain a new instance, then pass it to the SDK via the Big Segments config builder.

The same Redis database can be shared with RedisDataSource — Big Segments keys use their own prefixed namespaces (big_segment_include, big_segment_exclude, big_segments_synchronized_on) and do not conflict with the flag/segment hashes. The LaunchDarkly Relay Proxy is responsible for populating Big Segments data in Redis; this class only reads from it.

This implementation is backed by Redis++, a C++ wrapper for the hiredis library.

Member Function Documentation

◆ Create()

tl::expected< std::unique_ptr< RedisBigSegmentStore >, std::string > launchdarkly::server_side::integrations::RedisBigSegmentStore::Create ( std::string  uri,
std::string  prefix 
)
static

Creates a new RedisBigSegmentStore, or returns an error if construction failed.

Parameters
uriRedis URI. The URI is passed to the underlying Redis++ client verbatim. See Redis++ API Reference for details on the possible URI formats.
prefixPrefix to use when reading SDK data from Redis. This allows multiple LaunchDarkly environments to be stored in the same database (under different prefixes).
Returns
A RedisBigSegmentStore, or an error if construction failed.

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