-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: improve IDataSynchronizer's interface to expose IDestination #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| using T = std::decay_t<decltype(method_config)>; | ||
| if constexpr (std::is_same_v<T, | ||
| config::built::BackgroundSyncConfig:: | ||
| StreamingConfig>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-arranged the constructor arguments to follow our C++ standards.
| } | ||
|
|
||
| PollingDataSource::PollingDataSource( | ||
| boost::asio::any_io_executor const& ioc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes follow from re-arranging the constructor args.
| return identity; | ||
| } | ||
|
|
||
| StreamingDataSource::StreamingDataSource( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follows from re-arranging constructor args.
|
|
||
| [[nodiscard]] std::string const& Identity() const override; | ||
|
|
||
| private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match the constructor args, the members are re-arranged (so the order of initialization is visually correct.)
libs/server-sdk/src/data_systems/background_sync/sources/polling/polling_data_source.hpp
Outdated
Show resolved
Hide resolved
…ng/polling_data_source.hpp Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
This refactors
IDataSynchronizerto take anIDestinationand bootstrap data in itsStartAsyncmethod, rather than having an independentInitfunction.The addition of
IDestinationmakes the interface's purpose clearer.Before the destination was hidden - you'd only see it when constructing an implementation. Now it's clear that the
IDataSynchronizerputs data into theIDestination; no hidden dependency.It also doesn't make sense to "Init" an
IDataSynchronizerwith an SDKDataSet.The purpose of that call is to allow the synchronizer to inspect any existing data in possession by the SDK. The result of that inspection might mean an optimized fetch of initial data is possible (e.g. if there was an etag present in the initial data.)