C++ Server-Side SDK
LaunchDarkly SDK
|
#include <lazy_load_system.hpp>
Classes | |
struct | Kinds |
Public Types | |
using | ClockType = std::chrono::steady_clock |
using | TimeFn = std::function< std::chrono::time_point< ClockType >()> |
Public Member Functions | |
LazyLoad (Logger const &logger, config::built::LazyLoadConfig cfg, data_components::DataSourceStatusManager &status_manager) | |
LazyLoad (Logger const &logger, config::built::LazyLoadConfig cfg, data_components::DataSourceStatusManager &status_manager, TimeFn time) | |
std::string const & | Identity () const override |
std::shared_ptr< data_model::FlagDescriptor > | GetFlag (std::string const &key) const override |
Get the flag named by key. Returns nullptr if no such flag exists. | |
std::shared_ptr< data_model::SegmentDescriptor > | GetSegment (std::string const &key) const override |
Get the segment named by key. Returns nullptr if no such flag exists. | |
std::unordered_map< std::string, std::shared_ptr< data_model::FlagDescriptor > > | AllFlags () const override |
Get a map of all flags. | |
std::unordered_map< std::string, std::shared_ptr< data_model::SegmentDescriptor > > | AllSegments () const override |
Get a map of all segments. | |
void | Initialize () override |
Initializes the system. This method will be called before any of the IStore methods are called. | |
bool | Initialized () const override |
![]() | |
IDataSystem (IDataSystem const &item)=delete | |
IDataSystem (IDataSystem &&item)=delete | |
IDataSystem & | operator= (IDataSystem const &)=delete |
IDataSystem & | operator= (IDataSystem &&)=delete |
![]() | |
IStore (IStore const &item)=delete | |
IStore (IStore &&item)=delete | |
IStore & | operator= (IStore const &)=delete |
IStore & | operator= (IStore &&)=delete |
LazyLoad implements a Data System that pulls data from a persistent store on-demand. It is intended for use cases where holding an entire environment in memory isn't desired, or for uses that disallow direct communication with LaunchDarkly servers.
LazyLoad is able to remain efficient because it caches responses from the store. Over time, data becomes stale causing the system to refresh data.
|
overridevirtual |
Get a map of all flags.
Implements launchdarkly::server_side::data_interfaces::IStore.
|
overridevirtual |
Get a map of all segments.
Implements launchdarkly::server_side::data_interfaces::IStore.
|
overridevirtual |
Get the flag named by key. Returns nullptr if no such flag exists.
key | Key of the flag. |
Implements launchdarkly::server_side::data_interfaces::IStore.
|
overridevirtual |
Get the segment named by key. Returns nullptr if no such flag exists.
key | Key of the segment. |
Implements launchdarkly::server_side::data_interfaces::IStore.
|
overridevirtual |
Implements launchdarkly::server_side::data_interfaces::IDataSystem.
|
overridevirtual |
Initializes the system. This method will be called before any of the IStore methods are called.
Implements launchdarkly::server_side::data_interfaces::IDataSystem.
|
overridevirtual |
Implements launchdarkly::server_side::data_interfaces::IStore.