Restore disabled code#68
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the public forwarding header and expands/updates the Postgres examples (including adding two new “talk” variants), alongside a small build/dependency update.
Changes:
- Simplified
include/beman/net.hppto a minimal forwarding include. - Updated Postgres examples to reduce unused-variable warnings and added
postgres_talk_accuonsea/postgres_talk_cppnowto the examples build. - Updated the
bemanproject/taskFetchContent commit and adjusted beman-tidy path ignores.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| include/beman/net.hpp | Removes previously disabled/empty namespace declarations; now only forwards to <beman/net/net.hpp>. |
| examples/postgres.cpp | Adds [[maybe_unused]] and changes which example branch is compiled/executed. |
| examples/postgres_talk.cpp | Refactors Postgres coroutine/mutex example and changes error/cancellation handling. |
| examples/postgres_talk_cppnow.cpp | Adds a new “talk” variant example (CppNow). |
| examples/postgres_talk_accuonsea.cpp | Adds a new “talk” variant example (AccuOnSea), similar to postgres_talk.cpp. |
| examples/CMakeLists.txt | Fixes/extends the Postgres example list so the new examples are built when Postgres is available. |
| CMakeLists.txt | Updates the task dependency commit hash and comment formatting. |
| .beman-tidy.yaml | Adds include/beman/net.hpp to beman-tidy ignored paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+253
to
+258
| if constexpr (true) { | ||
| spawn(std::move(timer)); | ||
| #if 0 | ||
| spawn(std::move(request1) | ex::then([&scope] noexcept { scope.request_stop(); })); | ||
| ex::sync_wait(ex::when_all(io.async_run(), scope.join())); | ||
| #endif |
Comment on lines
66
to
69
| if (!PQsendQuery(conn, query.c_str())) { | ||
| co_yield ex::with_error(pg::error(PQerrorMessage(conn))); | ||
| std::cout << "ERROR: " << PQerrorMessage(conn) << "\n"; | ||
| throw std::runtime_error("ERROR"); | ||
| } |
Comment on lines
70
to
72
| while (PQflush(conn)) { | ||
| co_await ex::unstoppable(net::async_poll(conn.socket, net::event_type::out)); | ||
| co_await net::async_poll(conn.socket, net::event_type::out); | ||
| } |
Comment on lines
78
to
81
| co_await ex::unstoppable(net::async_poll(conn.socket, net::event_type::in)); | ||
| if (!PQconsumeInput(conn)) { | ||
| co_yield ex::with_error(pg::error(PQerrorMessage(conn))); | ||
| // error handling | ||
| } |
Comment on lines
9
to
+11
| ignored_paths: | ||
| - infra/ | ||
| - include/beman/net.hpp |
Comment on lines
+66
to
+69
| if (!PQsendQuery(conn, query.c_str())) { | ||
| std::cout << "ERROR: " << PQerrorMessage(conn) << "\n"; | ||
| throw std::runtime_error("ERROR"); | ||
| } |
Comment on lines
+77
to
+81
| while (PQisBusy(conn)) { | ||
| co_await ex::unstoppable(net::async_poll(conn.socket, net::event_type::in)); | ||
| if (!PQconsumeInput(conn)) { | ||
| // error handling | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.