Skip to content

Add needs_host_poll() and should_block_read() to IOPollable#753

Open
wdcui wants to merge 1 commit intomainfrom
wdcui/pr3c-iopollable
Open

Add needs_host_poll() and should_block_read() to IOPollable#753
wdcui wants to merge 1 commit intomainfrom
wdcui/pr3c-iopollable

Conversation

@wdcui
Copy link
Copy Markdown
Member

@wdcui wdcui commented Apr 7, 2026

Summary

  • Add needs_host_poll() default method to IOPollable — returns false by default; overridden by IO objects that require the host to perform the actual poll (e.g., host-backed stdin).
  • Add should_block_read() default method to IOPollable — returns true by default; overridden by IO objects where reads should never block even when the fd is in blocking mode.
  • Add Waker::ptr_eq() utility for comparing waker identity without waking.

Split from #743.

Add two new default methods to the IOPollable trait:

- needs_host_poll(): indicates the pollable cannot deliver async observer
  notifications (e.g. host-backed stdin), so callers should poll periodically.
- should_block_read(): indicates whether reads should block when no data is
  available. Returns false for fds that use epoll/poll and expect EAGAIN.

Both default to the backward-compatible behavior (no host poll needed,
reads block). Forward the methods through the Arc<T> blanket impl.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

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.

1 participant