C++ Server-Side SDK
LaunchDarkly SDK
Classes | Public Member Functions | List of all members
launchdarkly::server_side::data_systems::FDv2PollingInitializer Class Referencefinal

#include <polling_initializer.hpp>

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

Public Member Functions

 FDv2PollingInitializer (boost::asio::any_io_executor const &executor, Logger const &logger, std::string const &polling_base_url, config::built::HttpProperties const &http_properties, data_model::Selector selector, std::optional< std::string > filter_key)
 
async::Future< data_interfaces::FDv2SourceResultRun () override
 
void Close () override
 
std::string const & Identity () const override
 
- Public Member Functions inherited from launchdarkly::server_side::data_interfaces::IFDv2Initializer
 IFDv2Initializer (IFDv2Initializer const &)=delete
 
 IFDv2Initializer (IFDv2Initializer &&)=delete
 
IFDv2Initializeroperator= (IFDv2Initializer const &)=delete
 
IFDv2Initializeroperator= (IFDv2Initializer &&)=delete
 

Detailed Description

FDv2 polling initializer. Makes a single HTTP GET to the FDv2 polling endpoint, parses the response via the FDv2 protocol state machine, and returns the result.

Threading model: Run() should only be called once at a time. Close() may be called concurrently with Run(). This object may be safely destroyed once no call to Run() or Close() is in progress.

Constructor & Destructor Documentation

◆ FDv2PollingInitializer()

launchdarkly::server_side::data_systems::FDv2PollingInitializer::FDv2PollingInitializer ( boost::asio::any_io_executor const &  executor,
Logger const &  logger,
std::string const &  polling_base_url,
config::built::HttpProperties const &  http_properties,
data_model::Selector  selector,
std::optional< std::string >  filter_key 
)

Constructs an initializer for a single poll request. If filter_key is present, only the specified payload filter is requested.

Member Function Documentation

◆ Close()

void launchdarkly::server_side::data_systems::FDv2PollingInitializer::Close ( )
overridevirtual

Unblocks any in-progress Run() call, causing it to return FDv2SourceResult::Shutdown.

Implements launchdarkly::server_side::data_interfaces::IFDv2Initializer.

◆ Identity()

std::string const & launchdarkly::server_side::data_systems::FDv2PollingInitializer::Identity ( ) const
overridevirtual
Returns
A display-suitable name of the initializer.

Implements launchdarkly::server_side::data_interfaces::IFDv2Initializer.

◆ Run()

async::Future< FDv2SourceResult > launchdarkly::server_side::data_systems::FDv2PollingInitializer::Run ( )
overridevirtual

Returns a Future that resolves with the result once the initializer completes. Called at most once per instance.

Close() may be called from another thread to unblock Run(), in which case the future resolves with FDv2SourceResult::Shutdown.

Implements launchdarkly::server_side::data_interfaces::IFDv2Initializer.


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