refactor: add make_*/async_* co_await-able I/O API for files and networking#14
Closed
Copilot wants to merge 2 commits into
Closed
refactor: add make_*/async_* co_await-able I/O API for files and networking#14Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/Melnytskyi/fast_task/sessions/4241bca2-f56e-48f3-bd77-3b98105280c5 Co-authored-by: Melnytskyi <[email protected]>
…orking Agent-Logs-Url: https://github.com/Melnytskyi/fast_task/sessions/2a670101-1bfb-49bf-98aa-571d4c20801d Co-authored-by: Melnytskyi <[email protected]>
Copilot created this pull request from a session on behalf of
Melnytskyi
May 19, 2026 22:37
View session
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.
Summary
Exposes a coroutine-friendly async I/O surface over the existing file and networking primitives, enabling
co_await-based usage without blocking task threads.Changes
New public headers
include/net.hpp— canonical replacement fornetworking.hpp(which becomes a backward-compat#includeshim). Adds:make_read(uint32_t)/make_write(const char*, uint32_t)totcp_network_streamandtcp_network_blockingmake_accept(bool)totcp_network_server#include "future.hpp"so callers getfuture_ptr<T>in scopeinclude/coroutine/net.hpp— thinasync_read,async_write,async_acceptwrappers returningfuture_ptr<T>that can be directlyco_awaitedinclude/coroutine/file.hpp—async_read,async_read_at,async_read_fixed,async_read_fixed_at,async_write,async_write_at,async_appendwrappers overfile_handleModified files
include/networking.hpp— reduced to#include "net.hpp"shim for backward compatibilityinclude/files.hpp— addedmake_read,make_read_at,make_read_fixed,make_read_fixed_at,make_write,make_write_at,make_appenddeclarations onfile_handlesrc/files.cpp— thin delegating implementations of allfile_handle::make_*src/networking.cpp—make_read/make_writeimplemented in all four concrete classes (Windows stream, Windows blocking, Linux stream, Linux blocking);tcp_network_server::make_acceptwrapsaccept_blockingin afutureUsage example