Skip to content

Migrate sync IO backends to nonblocking descriptors/handles - #122

Merged
puddly merged 2 commits into
devfrom
puddly/nonblocking-sync-io
Sep 27, 2026
Merged

puddly merged 2 commits into
devfrom
puddly/nonblocking-sync-io

Conversation

@puddly

@puddly puddly commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Currently, the sync serial interface relies on blocking reads/writes. While simple, this has the downside of not fully respecting read/write timeouts and having poor behavior when it comes to reading partial data with a timeout. This slight re-implementation switches all file descriptors/device handles to nonblocking mode and relies on kernel events to wake on availability/data (and a guaranteed read/write), as opposed to relying on the read/write call itself erroring appropriately.

Fixes #102 as a side effect

@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.78947% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.05%. Comparing base (779a495) to head (62a0b50).

Files with missing lines Patch % Lines
serialx/platforms/serial_posix.py 79.31% 6 Missing ⚠️
serialx/platforms/serial_rfc2217/__init__.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #122      +/-   ##
==========================================
- Coverage   94.08%   94.05%   -0.04%     
==========================================
  Files          24       24              
  Lines        4025     4055      +30     
==========================================
+ Hits         3787     3814      +27     
- Misses        238      241       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@puddly
puddly merged commit e7fc1d8 into dev Sep 27, 2026
57 of 64 checks passed
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.

Synchronous connection fails on MacOS

1 participant