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

Python HTTP Server Example #115

Merged
merged 13 commits into from
Oct 14, 2024
Merged

Python HTTP Server Example #115

merged 13 commits into from
Oct 14, 2024

Conversation

Depetrol
Copy link
Collaborator

@Depetrol Depetrol commented Oct 2, 2024

No description provided.

@Depetrol Depetrol requested a review from edwardalee October 8, 2024 22:04
Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

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

LGTM. At some point, it would be good develop the WebServer reactors into a reusable library reactor, as done in the C playground, but this is a good starting point for such a project. I've suggested a bunch of very minor editing changes and raised some questions.

examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/README.md Show resolved Hide resolved
examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/logging.lf Outdated Show resolved Hide resolved
@Depetrol
Copy link
Collaborator Author

Thank you for your detailed comments! I implemented a reusable library reactor WebServer that can handle HTTP requests. I had difficulty abstracting the reusable reactor because of routing issues, and I found that this could be bypassed by sending the routing information as payload instead of using different endpoints. I also reimplemented both examples(+1 and logging) using the reusable library reactor, and I think the code has cleaned up quite a bit. Some documentation was also added.

Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

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

The library reactor looks great! I added a couple more questions, but otherwise this is ready to merge.

examples/Python/src/WebServer/README.md Outdated Show resolved Hide resolved
examples/Python/src/WebServer/logging.svg Outdated Show resolved Hide resolved
examples/Python/src/lib/WebServer.lf Outdated Show resolved Hide resolved
@Depetrol Depetrol merged commit 38cec27 into lf-lang:main Oct 14, 2024
5 checks passed
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