Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(compat): runtime compatibility layers#920

Merged
Berrysoft merged 14 commits into
compio-rs:masterfrom
Berrysoft:compio-compat
May 15, 2026
Merged

feat(compat): runtime compatibility layers#920
Berrysoft merged 14 commits into
compio-rs:masterfrom
Berrysoft:compio-compat

Conversation

@Berrysoft
Copy link
Copy Markdown
Member

Needs #919

This feature is not enabled by "default" or "all".

@Berrysoft Berrysoft self-assigned this May 13, 2026
@Berrysoft Berrysoft requested a review from Copilot May 13, 2026 17:08
@github-actions github-actions Bot added the enhancement New feature or request label May 13, 2026
@Berrysoft Berrysoft added this to the v0.19 milestone May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new optional “compat” layer so compio’s runtime can be driven from external event loops (e.g., Tokio or futures/async-io), including a new flush API to support integration patterns like “wait on driver fd/handle externally”.

Changes:

  • Introduces new compio-compat crate with RuntimeCompat + platform adapters (Tokio / futures / Windows).
  • Adds Runtime::flush / Proactor::flush and driver-specific flush implementations to support external event-loop integration.
  • Extends benches and CI matrix to exercise the new compatibility features.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
compio/src/lib.rs Re-exports compio_compat as compio::compat behind the compat feature.
compio/Cargo.toml Adds optional compio-compat dep + compat-* feature flags; adds dev-dep used by benches.
compio/benches/net.rs Refactors compio echo benchmarks and adds compat-driven benchmark variants.
compio/benches/fs.rs Refactors FS benchmarks and adds compat-driven benchmark variants.
compio/benches/compat/mod.rs New bench-only module to select compat executors by feature.
compio/benches/compat/in_tokio.rs Criterion AsyncExecutor implementation to run compio inside Tokio.
compio/benches/compat/in_futures.rs Criterion AsyncExecutor implementation to run compio inside futures_executor.
compio-runtime/src/lib.rs Adds Runtime::flush() delegating to the underlying driver/proactor.
compio-driver/src/sys/driver/stub/mod.rs Adds stub flush() implementation.
compio-driver/src/sys/driver/poll/mod.rs Adds polling-driver flush() and adjusts awake-flag handling in poll path.
compio-driver/src/sys/driver/mod.rs Adjusts AwakeFlag behavior (atomic op change).
compio-driver/src/sys/driver/iour/mod.rs Adds io-uring flush() and adjusts awake-flag handling in poll path.
compio-driver/src/sys/driver/iocp/mod.rs Adds IOCP flush() implementation.
compio-driver/src/sys/driver/fusion/mod.rs Delegates flush() to the active fused driver.
compio-driver/src/lib.rs Adds public Proactor::flush() API with docs for external-loop usage.
compio-driver/Cargo.toml Switches mod_use dependency to workspace-managed.
compio-compat/src/lib.rs New crate: core RuntimeCompat execution loop integrating adapter wait/clear + runtime flush.
compio-compat/src/sys/mod.rs New crate: defines Adapter trait and OS dispatch.
compio-compat/src/sys/unix/mod.rs New crate: Unix adapter that optionally registers an eventfd for io-uring.
compio-compat/src/sys/unix/tokio.rs New crate: Tokio adapter using tokio::io::unix::AsyncFd.
compio-compat/src/sys/unix/futures.rs New crate: futures adapter using async-io.
compio-compat/src/sys/windows.rs New crate: Windows adapter waiting via WaitForMultipleObjects.
compio-compat/tests/net.rs New crate tests covering TCP client/server interop under Tokio.
compio-compat/tests/fs.rs New crate tests covering filesystem reads under adapters.
compio-compat/README.md New crate README with basic usage example.
compio-compat/Cargo.toml New crate manifest with features for tokio/futures adapters and platform deps.
Cargo.toml Adds compio-compat to workspace members + workspace deps.
.github/workflows/ci_test.yml Expands CI test matrix to include compat-all feature combos.

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

Comment thread compio-compat/src/lib.rs
Comment thread compio/benches/compat/in_tokio.rs
Comment thread compio/benches/compat/in_futures.rs
Comment thread compio-driver/src/sys/driver/mod.rs
Comment thread compio-compat/src/sys/windows.rs
Comment thread compio-compat/Cargo.toml Outdated
fantix
fantix previously approved these changes May 14, 2026
Copy link
Copy Markdown
Collaborator

@fantix fantix left a comment

Choose a reason for hiding this comment

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

LGTM overall!

Comment thread compio-compat/tests/net.rs
Comment thread compio-compat/src/sys/unix/mod.rs Outdated
@Berrysoft Berrysoft merged commit 9df2ba7 into compio-rs:master May 15, 2026
83 checks passed
@Berrysoft Berrysoft deleted the compio-compat branch May 15, 2026 02:10
This was referenced May 13, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants