C++ Server-Side SDK
LaunchDarkly SDK
Loading...
Searching...
No Matches
Public Member Functions | List of all members
launchdarkly::server_side::data_systems::BackgroundSync Class Referencefinal

#include <background_sync_system.hpp>

Inheritance diagram for launchdarkly::server_side::data_systems::BackgroundSync:
Inheritance graph
[legend]
Collaboration diagram for launchdarkly::server_side::data_systems::BackgroundSync:
Collaboration graph
[legend]

Public Member Functions

 BackgroundSync (config::built::ServiceEndpoints const &endpoints, config::built::BackgroundSyncConfig const &background_sync_config, config::built::HttpProperties http_properties, boost::asio::any_io_executor ioc, data_components::DataSourceStatusManager &status_manager, Logger const &logger)
 
 BackgroundSync (BackgroundSync const &item)=delete
 
 BackgroundSync (BackgroundSync &&item)=delete
 
BackgroundSyncoperator= (BackgroundSync const &)=delete
 
BackgroundSyncoperator= (BackgroundSync &&)=delete
 
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.
 
std::string const & Identity () const override
 
void Initialize () override
 Initializes the system. This method will be called before any of the IStore methods are called.
 
bool Initialized () const override
 
- Public Member Functions inherited from launchdarkly::server_side::data_interfaces::IDataSystem
 IDataSystem (IDataSystem const &item)=delete
 
 IDataSystem (IDataSystem &&item)=delete
 
IDataSystemoperator= (IDataSystem const &)=delete
 
IDataSystemoperator= (IDataSystem &&)=delete
 
- Public Member Functions inherited from launchdarkly::server_side::data_interfaces::IStore
 IStore (IStore const &item)=delete
 
 IStore (IStore &&item)=delete
 
IStoreoperator= (IStore const &)=delete
 
IStoreoperator= (IStore &&)=delete
 

Detailed Description

BackgroundSync implements the standard Data System which receives data updates from LaunchDarkly as they happen. It updates an in-memory store with the data, and always operates with a complete dataset.

The BackgroundSync system is advantageous because it allows flag evaluations to take place with up-to-date information. However, some environments may be too large to fit in memory, or a direct connection to LaunchDarkly isn't desired, necessitating use of the alternate LazyLoad system.

Member Function Documentation

◆ AllFlags()

std::unordered_map< std::string, std::shared_ptr< data_model::FlagDescriptor > > launchdarkly::server_side::data_systems::BackgroundSync::AllFlags ( ) const
overridevirtual

Get a map of all flags.

Returns
Map of shared pointers to flags.

Implements launchdarkly::server_side::data_interfaces::IStore.

◆ AllSegments()

std::unordered_map< std::string, std::shared_ptr< data_model::SegmentDescriptor > > launchdarkly::server_side::data_systems::BackgroundSync::AllSegments ( ) const
overridevirtual

Get a map of all segments.

Returns
Map of shared pointers to segments.

Implements launchdarkly::server_side::data_interfaces::IStore.

◆ GetFlag()

std::shared_ptr< data_model::FlagDescriptor > launchdarkly::server_side::data_systems::BackgroundSync::GetFlag ( std::string const &  key) const
overridevirtual

Get the flag named by key. Returns nullptr if no such flag exists.

Parameters
keyKey of the flag.
Returns
Shared pointer to the flag.

Implements launchdarkly::server_side::data_interfaces::IStore.

◆ GetSegment()

std::shared_ptr< data_model::SegmentDescriptor > launchdarkly::server_side::data_systems::BackgroundSync::GetSegment ( std::string const &  key) const
overridevirtual

Get the segment named by key. Returns nullptr if no such flag exists.

Parameters
keyKey of the segment.
Returns
Shared pointer to the segment.

Implements launchdarkly::server_side::data_interfaces::IStore.

◆ Identity()

std::string const & launchdarkly::server_side::data_systems::BackgroundSync::Identity ( ) const
overridevirtual
Returns
Identity of the system. Used in logs.

Implements launchdarkly::server_side::data_interfaces::IDataSystem.

◆ Initialize()

void launchdarkly::server_side::data_systems::BackgroundSync::Initialize ( )
overridevirtual

Initializes the system. This method will be called before any of the IStore methods are called.

Implements launchdarkly::server_side::data_interfaces::IDataSystem.

◆ Initialized()

bool launchdarkly::server_side::data_systems::BackgroundSync::Initialized ( ) const
overridevirtual
Returns
True if the store has ever contained data.

Implements launchdarkly::server_side::data_interfaces::IStore.


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