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

Implement co-routine based streams for beast-based HTTP server #513

Merged
merged 28 commits into from Dec 6, 2021

Conversation

RobinTF
Copy link
Collaborator

@RobinTF RobinTF commented Nov 30, 2021

This PR basically implements a custom body type, that uses coroutines to send data to the client instead of accumulating everything inside a giant string.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

Thank your very much.

Overall this already looks very great,
my main comments are about comments/claraifications.

This is mostly "just" lacking some unit tests.

src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/HttpServer/HttpUtils.h Outdated Show resolved Hide resolved
src/util/HttpServer/HttpUtils.h Show resolved Hide resolved
src/engine/QueryExecutionTree.cpp Show resolved Hide resolved
while (generator.hasNext()) {
out << generator.next();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this still needed by some legacy APIs, which are not Server.h ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The only remaining usage can be found here:

qet.writeResultToStream(cout, pq._selectClause._selectedVariables, limit,
offset);

src/engine/QueryExecutionTree.h Show resolved Hide resolved
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

Now basically only unit tests are missing.

src/util/HttpServer/streamable_body.h Show resolved Hide resolved
src/util/HttpServer/streamable_body.h Outdated Show resolved Hide resolved
src/util/HttpServer/streamable_body.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
src/util/streamable_generator.h Outdated Show resolved Hide resolved
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

Last round of reviews.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

A

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

Thank you very much,
This is a very useful and cleanly written implementation!

@joka921 joka921 merged commit ba9ecf0 into ad-freiburg:master Dec 6, 2021
@RobinTF RobinTF deleted the http-stream branch December 6, 2021 14:39
@RobinTF RobinTF mentioned this pull request Dec 6, 2021
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