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

#include <streaming_synchronizer.hpp>

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

Public Member Functions

 FDv2StreamingSynchronizer (boost::asio::any_io_executor const &executor, Logger const &logger, std::string streaming_base_url, config::built::HttpProperties const &http_properties, std::optional< std::string > filter_key, std::chrono::milliseconds initial_reconnect_delay)
 
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
 

Friends

class FDv2StreamingSynchronizerTestPeer
 

Detailed Description

FDv2 streaming synchronizer. Opens an SSE connection to the FDv2 streaming endpoint and translates the push-based event stream into the pull-based IFDv2Synchronizer::Next() interface.

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

◆ FDv2StreamingSynchronizer()

launchdarkly::server_side::data_systems::FDv2StreamingSynchronizer::FDv2StreamingSynchronizer ( boost::asio::any_io_executor const &  executor,
Logger const &  logger,
std::string  streaming_base_url,
config::built::HttpProperties const &  http_properties,
std::optional< std::string >  filter_key,
std::chrono::milliseconds  initial_reconnect_delay 
)

Constructs a synchronizer that streams from the FDv2 streaming endpoint. If filter_key is present, only the specified payload filter is requested.

Member Function Documentation

◆ Close()

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