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

fix: remove 100ms delay on first and subsequent read calls #76

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

SilverMira
Copy link
Contributor

Currently, there is an unnecessary wait with recv_timeout() on reader thread and cache thread.

On reader thread, it causes reading from pipe to have an inherent 100ms wait time between each chunk read.
Similarly, cache thread also has this issue, where read() calls are served throttled with a 100ms delay.

This PR replaces recv_timeout with try_recv so all read() calls will return as soon as possible.

Fixes #75

Currently, there is an unnecessary wait with `recv_timeout()` on reader thread which causes reading from pipe to have an inherent 100ms wait time.

Similarly, cache thread also has this issue, where read() calls are served throttled with a 100ms delay
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.63%. Comparing base (dbbefcd) to head (5a8aab1).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   77.57%   78.63%   +1.05%     
==========================================
  Files           7        7              
  Lines        1231     1231              
==========================================
+ Hits          955      968      +13     
+ Misses        276      263      -13     
Flag Coverage Δ
unittests 78.63% <100.00%> (+1.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@andfoy andfoy merged commit 1ecee27 into andfoy:main Jun 28, 2024
4 checks passed
@andfoy
Copy link
Owner

andfoy commented Jun 28, 2024

Thanks a lot for your contribution @SilverMira!

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.

Minimum of 100ms latency on .read() calls performed repeatedly
3 participants