|
C++ Server-Side SDK
LaunchDarkly SDK
|
#include <polling_synchronizer.hpp>


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::FDv2SourceResult > | Next (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 | |
| IFDv2Synchronizer & | operator= (IFDv2Synchronizer const &)=delete |
| IFDv2Synchronizer & | operator= (IFDv2Synchronizer &&)=delete |
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.
| 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.
|
overridevirtual |
Unblocks any in-progress Next() call, causing it to return FDv2SourceResult::Shutdown, and releases underlying resources.
Implements launchdarkly::server_side::data_interfaces::IFDv2Synchronizer.
|
overridevirtual |
Implements launchdarkly::server_side::data_interfaces::IFDv2Synchronizer.
|
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.
| selector | The selector to send with the request, reflecting any changesets applied since the previous call. |
Implements launchdarkly::server_side::data_interfaces::IFDv2Synchronizer.