-
Notifications
You must be signed in to change notification settings - Fork 998
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
feat(server): Buffered journal serializers #619
feat(server): Buffered journal serializers #619
Conversation
Signed-off-by: Vladislav Oleshko <[email protected]>
src/server/journal_test.cc
Outdated
for (const auto& entry : test_entries) { | ||
writer.Write(entry); | ||
} | ||
|
||
// Read them back. | ||
io::BytesSource bs{io::Buffer(ss.str())}; | ||
JournalReader reader{0}; | ||
io::BytesSource bs{writer.Accumulated()}; |
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.
The Accumulated function is only used in test.. Why do you use it and not just flush to io::StringSink ?
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.
Indeed, I forgot to make rdb saver use it as well. Its better than doing a double copy
JournalWriter writer{flow->conn->socket()}; | ||
auto journal_cb = [flow, writer = std::move(writer)](const journal::Entry& je) mutable { | ||
writer.Write(je); | ||
writer = new JournalWriter{}; |
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.
maybe the writer can be in flow struct, as rdb save is in flow
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.
There is no need to, it will be replaced anyway in the next pr
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
// Return reference to internal buffer. | ||
base::IoBuf& Accumulated(); | ||
|
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.
I want to make base::IoBuf movable in helio and then let the new journal streamer just swap it instead of doing a copy
await asyncio.sleep(0.5) | ||
await asyncio.sleep(1.0) |
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.
I suspect they failed last time because of the small delay
No description provided.