Skip to content
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

Always relay messages in batches #284

Merged
merged 1 commit into from Oct 6, 2019
Merged

Conversation

msgmaxim
Copy link
Contributor

@msgmaxim msgmaxim commented Oct 2, 2019

We want to minimise the number of connections to other SS, so instead of relaying messages individually, we accumulate them in a buffer, processing it periodically (every 200ms).

Copy link
Contributor

@BeaudanBrown BeaudanBrown left a comment

Choose a reason for hiding this comment

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

Question but otherwise makes sense

void ServiceNode::relay_buffered_messages() {

// Should we wait for the response first?
constexpr std::chrono::milliseconds RELAY_INTERVAL = 500ms;
Copy link
Contributor

Choose a reason for hiding this comment

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

2 differently scoped definitions of RELAY_INTERVAL for 200ms and 500ms
Should we just define in larger scope once or just make these the same? Or is the 500ms deliberate because it includes the actual relaying?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not deliberate, let's use 350ms for both as the average :)

@msgmaxim msgmaxim merged commit 6a48312 into oxen-io:dev Oct 6, 2019
@msgmaxim msgmaxim deleted the batch-all branch October 7, 2019 06:40
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.

None yet

2 participants