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

#include <fdv1_adapter_synchronizer.hpp>

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

Public Types

using SourceBuilder = std::function< std::shared_ptr< data_interfaces::IDataSynchronizer >(data_components::DataSourceStatusManager &)>
 

Public Member Functions

 FDv1AdapterSynchronizer (SourceBuilder source_builder)
 
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

Adapts an FDv1 IDataSynchronizer to the IFDv2Synchronizer interface.

FDv1 Init/Upsert callbacks delivered through an internal IDestination are translated into FDv2SourceResult::ChangeSet results, with empty selectors and fdv1_fallback = false (the directive does not re-fire from FDv1 data).

Threading: Next() and Close() may be called from any thread; only one Next() may be outstanding at a time. Member declaration order ensures the wrapped FDv1 source destructs before destination_ and state_, so any in-flight FDv1 callbacks land on live objects during teardown. This relies on the wrapped IDataSynchronizer blocking on its in-flight work in its destructor.

Constructor & Destructor Documentation

◆ FDv1AdapterSynchronizer()

launchdarkly::server_side::data_systems::FDv1AdapterSynchronizer::FDv1AdapterSynchronizer ( SourceBuilder  source_builder)
explicit
Parameters
source_builderCalled once during construction with the adapter's status manager. Returns the wrapped FDv1 source, which must be constructed against the provided manager as its status sink.

Member Function Documentation

◆ Close()

void launchdarkly::server_side::data_systems::FDv1AdapterSynchronizer::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::FDv1AdapterSynchronizer::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::FDv1AdapterSynchronizer::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: