Skip to content

feat(io): make SyncStream splittable#862

Merged
Berrysoft merged 3 commits intocompio-rs:masterfrom
Berrysoft:dev/splittable
Apr 14, 2026
Merged

feat(io): make SyncStream splittable#862
Berrysoft merged 3 commits intocompio-rs:masterfrom
Berrysoft:dev/splittable

Conversation

@Berrysoft
Copy link
Copy Markdown
Member

No description provided.

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

This PR extends the compat::SyncStream adapter to support splitting into independent read/write halves by implementing the crate’s Splittable trait, while refactoring the internal buffering into dedicated read/write buffer helpers.

Changes:

  • Refactor SyncStream buffering into SyncReadBuf / SyncWriteBuf and add SyncStreamReadHalf / SyncStreamWriteHalf.
  • Implement Splittable for SyncStream<S> (when S: Splittable) to enable .split().
  • Update AsyncReadStream / AsyncWriteStream to reference the new DEFAULT_MAX_BUFFER location.

Reviewed changes

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

File Description
compio-io/src/compat/sync_stream.rs Refactors buffering and adds split read/write halves + Splittable impl for SyncStream.
compio-io/src/compat/async_stream.rs Switches to super::DEFAULT_MAX_BUFFER after moving the constant out of SyncStream’s impl.

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

Comment thread compio-io/src/compat/sync_stream.rs
Comment thread compio-io/src/compat/sync_stream.rs
Comment thread compio-io/src/compat/sync_stream.rs
Comment thread compio-io/src/compat/sync_stream.rs
@Berrysoft Berrysoft requested a review from George-Miao April 13, 2026 15:29
Copy link
Copy Markdown
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

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

LGTM

@Berrysoft Berrysoft added this pull request to the merge queue Apr 14, 2026
Merged via the queue into compio-rs:master with commit e184d6c Apr 14, 2026
72 checks passed
@Berrysoft Berrysoft deleted the dev/splittable branch April 14, 2026 02:02
@github-actions github-actions bot mentioned this pull request Apr 14, 2026
@Berrysoft Berrysoft added this to the v0.19 milestone Apr 16, 2026
@Berrysoft Berrysoft added the package: io Related to compio-io label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: io Related to compio-io

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants