3#include "event_handler.hpp"
5#include "../../../../data_components/status_notifications/data_source_status_manager.hpp"
6#include "../../../../data_interfaces/destination/idestination.hpp"
7#include "../../../../data_interfaces/source/idata_synchronizer.hpp"
9#include <launchdarkly/logging/logger.hpp>
10#include <launchdarkly/server_side/config/built/all_built.hpp>
11#include <launchdarkly/sse/client.hpp>
13#include <boost/asio/any_io_executor.hpp>
15namespace launchdarkly::server_side::data_systems {
19 public std::enable_shared_from_this<StreamingDataSource> {
22 boost::asio::any_io_executor io,
30 data_model::SDKDataSet
const* bootstrap_data)
override;
31 void ShutdownAsync(std::function<
void()> completion)
override;
33 [[nodiscard]] std::string
const&
Identity()
const override;
36 void HandleErrorStateChange(sse::Error error, std::string error_string);
38 boost::asio::any_io_executor io_;
39 Logger
const& logger_;
44 std::optional<DataSourceEventHandler> event_handler_;
45 std::string streaming_endpoint_;
49 std::shared_ptr<sse::Client> client_;
Definition http_properties.hpp:26
Definition service_endpoints.hpp:11
Definition data_source_status_manager.hpp:16
IDataSynchronizer obtains data via a background synchronization mechanism, updating an IDestination w...
Definition idata_synchronizer.hpp:17
IDestination represents a sink for data received by the SDK. A destination may be a database,...
Definition idestination.hpp:14
Definition streaming_data_source.hpp:19
void StartAsync(data_interfaces::IDestination *dest, data_model::SDKDataSet const *bootstrap_data) override
Starts synchronizing data into the given IDestination.
Definition streaming_data_source.cpp:45
std::string const & Identity() const override
Definition streaming_data_source.cpp:26
void ShutdownAsync(std::function< void()> completion) override
Stops the synchronization mechanism. Stop will be called only once after StartAsync....
Definition streaming_data_source.cpp:207