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

#include <polling_synchronizer.hpp>

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

Public Member Functions

 FDv2PollingSynchronizer (boost::asio::any_io_executor const &executor, Logger const &logger, std::string polling_base_url, config::built::HttpProperties const &http_properties, std::optional< std::string > filter_key, std::chrono::seconds poll_interval)
 
async::Future< data_interfaces::FDv2SourceResultNext (data_model::Selector selector) override
 
void Close () override
 
std::string const & Identity () const override
 
- Public Member Functions inherited from launchdarkly::server_side::data_interfaces::IFDv2Synchronizer
 IFDv2Synchronizer (IFDv2Synchronizer const &)=delete
 
 IFDv2Synchronizer (IFDv2Synchronizer &&)=delete
 
IFDv2Synchronizeroperator= (IFDv2Synchronizer const &)=delete
 
IFDv2Synchronizeroperator= (IFDv2Synchronizer &&)=delete
 

Detailed Description

FDv2 polling synchronizer. Repeatedly polls the FDv2 polling endpoint at a configurable interval.

The caller passes the current selector into each Next() call, allowing the orchestrator to reflect applied changesets without any shared state.

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

Constructor & Destructor Documentation

◆ FDv2PollingSynchronizer()

launchdarkly::server_side::data_systems::FDv2PollingSynchronizer::FDv2PollingSynchronizer ( boost::asio::any_io_executor const &  executor,
Logger const &  logger,
std::string  polling_base_url,
config::built::HttpProperties const &  http_properties,
std::optional< std::string >  filter_key,
std::chrono::seconds  poll_interval 
)

Constructs a synchronizer that polls at the given interval. If filter_key is present, only the specified payload filter is requested.

Member Function Documentation

◆ Close()

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

Unblocks any in-progress Next() call, causing it to return FDv2SourceResult::Shutdown, and releases underlying resources.

Implements launchdarkly::server_side::data_interfaces::IFDv2Synchronizer.

◆ Identity()

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

Implements launchdarkly::server_side::data_interfaces::IFDv2Synchronizer.

◆ Next()

async::Future< FDv2SourceResult > launchdarkly::server_side::data_systems::FDv2PollingSynchronizer::Next ( data_model::Selector  selector)
overridevirtual

Returns a Future that resolves with the next result once it is available.

On the first call, the synchronizer starts its underlying connection. Subsequent calls continue reading from the same connection.

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

Parameters
selectorThe selector to send with the request, reflecting any changesets applied since the previous call.

Implements launchdarkly::server_side::data_interfaces::IFDv2Synchronizer.


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