Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a ring buffer to pipe data between IO objects #819

Merged
merged 8 commits into from
Jan 23, 2024
Merged

Conversation

pvdrz
Copy link
Collaborator

@pvdrz pvdrz commented Jan 16, 2024

This PR supersedes #617

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (2fa9234) 57.36% compared to head (d2fad50) 58.59%.
Report is 15 commits behind head on main.

Files Patch % Lines
src/exec/use_pty/pipe/mod.rs 0.00% 11 Missing ⚠️
src/exec/use_pty/pipe/ring_buffer.rs 96.57% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #819      +/-   ##
==========================================
+ Coverage   57.36%   58.59%   +1.22%     
==========================================
  Files          74       75       +1     
  Lines       10559    10732     +173     
==========================================
+ Hits         6057     6288     +231     
+ Misses       4502     4444      -58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@japaric japaric left a comment

Choose a reason for hiding this comment

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

Overall, looks good to me but I left some suggestions.

// ▲
// │
// start
buf.insert(&mut [0u8; HALF_LEN].as_slice()).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

in this particular case you could set the initial condition by directly setting the value of start to HALF_LEN. that way this unit test does not rely on insert and remove correctly working in cases 1.1 and 2.1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I thought about it but I think I'd rather leave those tests as implementation agnostic as possible.

@pvdrz pvdrz requested a review from japaric January 23, 2024 20:44
@pvdrz pvdrz added this pull request to the merge queue Jan 23, 2024
Merged via the queue into main with commit 208a25b Jan 23, 2024
15 checks passed
@pvdrz pvdrz deleted the pvdrz-ring-buffer branch January 24, 2024 00:24
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.

2 participants