Skip to content

Conversation

@cwaldren-ld
Copy link
Contributor

This refactors IDataSynchronizer to take an IDestination and bootstrap data in its StartAsync method, rather than having an independent Init function.

The addition of IDestination makes 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 IDataSynchronizer puts data into the IDestination; no hidden dependency.

It also doesn't make sense to "Init" an IDataSynchronizer with 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.)

@cwaldren-ld cwaldren-ld requested review from a team and keelerm84 November 22, 2023 18:21
using T = std::decay_t<decltype(method_config)>;
if constexpr (std::is_same_v<T,
config::built::BackgroundSyncConfig::
StreamingConfig>) {
Copy link
Contributor Author

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,
Copy link
Contributor Author

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(
Copy link
Contributor Author

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:
Copy link
Contributor Author

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.)

@cwaldren-ld cwaldren-ld changed the title refactor: update IDataSynchronizer's interface refactor: improve IDataSynchronizer's interface to expose IDestination Nov 22, 2023
…ng/polling_data_source.hpp

Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
@cwaldren-ld cwaldren-ld merged commit 2d75d3a into feat/data-system Nov 27, 2023
@cwaldren-ld cwaldren-ld deleted the cw/isynchronizer-changes branch November 27, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants