Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

ROBJSTORE-98 Implement precise and unbatched notification of sync completion events #1118

Merged
merged 2 commits into from
Oct 17, 2020

Conversation

jbreams
Copy link
Contributor

@jbreams jbreams commented Oct 9, 2020

Opening this in lieu of #1054.

@jbreams
Copy link
Contributor Author

jbreams commented Oct 13, 2020

@tgoyne let me know if you have time to review this.

Copy link
Member

@tgoyne tgoyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic looks correct to me and just a few trivial nits.

SyncSession::CompletionCallbacks callbacks_to_register;
std::swap(session.m_completion_callbacks, callbacks_to_register);

for (auto& [ id, callback_tuple ] : callbacks_to_register) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing on structured binding is inconsistent here; some have spaces in [] and some don't. I think no spaces is the normal thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

auto download_handlers = std::move(m_download_completion_callbacks);
auto upload_handlers = std::move(m_upload_completion_callbacks);

auto completion_callbacks = std::move(m_completion_callbacks);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the other spots we do this you changed it to swapping with a local which is probably better, so this one should as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I also added a FIXME comment since I realized advance_state is not exception safe so we should make sure that we always move the callbacks back in place by using a guard type, but I don't think we need to fix that in this PR.

@jbreams jbreams merged commit 3377523 into v10 Oct 17, 2020
@jbreams jbreams deleted the jbr/ROBJSTORE-98 branch October 17, 2020 22:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants