Skip to content

feat(runtime): poll-based API for PollFd#944

Merged
Berrysoft merged 9 commits into
compio-rs:masterfrom
Berrysoft:dev/poll-fd-poll-io
Jun 14, 2026
Merged

feat(runtime): poll-based API for PollFd#944
Berrysoft merged 9 commits into
compio-rs:masterfrom
Berrysoft:dev/poll-fd-poll-io

Conversation

@Berrysoft

Copy link
Copy Markdown
Member

No description provided.

@Berrysoft
Berrysoft requested review from George-Miao and Copilot June 5, 2026 08:23
@Berrysoft Berrysoft added package: net Related to compio-net package: runtime Related to compio-runtime labels Jun 5, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a poll-based readiness API for compio-runtime::fd::PollFd, enabling integration with manual poll_* workflows (and futures_util I/O traits) in addition to the existing async *_ready().await methods.

Changes:

  • Added poll_*_ready and poll_*_with methods to PollFd, plus futures_util::AsyncRead/AsyncWrite impls.
  • Refactored platform implementations to support polling (unix stores in-flight submissions; windows adds shared submission + waker fan-out).
  • Added read_buf feature plumbing through compio/compio-runtime, and exposed a new WakerArrayRef helper from compio-io.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
compio/Cargo.toml Extends the workspace read_buf feature to include compio-runtime.
compio-runtime/src/lib.rs Enables nightly read_buf/BorrowedCursor support behind the read_buf feature.
compio-runtime/src/fd/poll_fd/windows.rs Adds poll-based readiness implementation and shared-waker polling path on Windows.
compio-runtime/src/fd/poll_fd/unix.rs Adds poll-based readiness implementation using cached in-flight submissions on Unix.
compio-runtime/src/fd/poll_fd/mod.rs Adds public poll APIs, poll_*_with helpers, and futures_util AsyncRead/AsyncWrite impls.
compio-runtime/Cargo.toml Adds read_buf feature and a Windows-only compio-io dependency for compat utilities.
compio-net/tests/poll.rs Updates tests to exercise the new poll-based helpers and AsyncWrite usage.
compio-io/src/compat/waker_array.rs Documents WakerArrayRef (multi-waker fan-out).
compio-io/src/compat/mod.rs Re-exports the waker-array compat utility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compio-runtime/src/fd/poll_fd/windows.rs
Comment thread compio-runtime/src/fd/poll_fd/mod.rs Outdated
@George-Miao

George-Miao commented Jun 5, 2026

Copy link
Copy Markdown
Member

We should let current async methods to use internal Submit (.await new poll methods) as well

@George-Miao George-Miao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Above

@Berrysoft
Berrysoft requested a review from George-Miao June 5, 2026 12:54
@Berrysoft

Copy link
Copy Markdown
Member Author

@George-Miao ping? Do you think this PR is OK to be published under v0.19?

@George-Miao

Copy link
Copy Markdown
Member

@George-Miao ping? Do you think this PR is OK to be published under v0.19?

Sure. LGTM.

@Berrysoft
Berrysoft enabled auto-merge (squash) June 14, 2026 15:34
@Berrysoft
Berrysoft merged commit 654a3f0 into compio-rs:master Jun 14, 2026
82 checks passed
@Berrysoft
Berrysoft deleted the dev/poll-fd-poll-io branch June 14, 2026 15:35
@github-actions github-actions Bot mentioned this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request package: net Related to compio-net package: runtime Related to compio-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants