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::RedisDataSource Class Referencefinal

RedisDataSource represents a data source for the Server-Side SDK backed by Redis. It is meant to be used in place of the standard LaunchDarkly Streaming or Polling data sources. More...

#include <redis_source.hpp>

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

Public Member Functions

GetResult Get (ISerializedItemKind const &kind, std::string const &itemKey) const override
 
AllResult All (ISerializedItemKind const &kind) const override
 
std::string const & Identity () const override
 
bool Initialized () const override
 

Static Public Member Functions

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

Detailed Description

RedisDataSource represents a data source for the Server-Side SDK backed by Redis. It is meant to be used in place of the standard LaunchDarkly Streaming or Polling data sources.

Call RedisDataSource::Create to obtain a new instance. This instance can be passed into the SDK's DataSystem configuration via the LazyLoad builder.

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

Member Function Documentation

◆ Create()

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

Creates a new RedisDataSource, 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 RedisDataSource, or an error if construction failed.

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