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

[#20] MPSC goes to sleep if empty #21

Merged
merged 2 commits into from
Dec 13, 2023
Merged

[#20] MPSC goes to sleep if empty #21

merged 2 commits into from
Dec 13, 2023

Conversation

maypok86
Copy link
Owner

@maypok86 maypok86 commented Dec 12, 2023

Description

When the write buffer is empty, CPU consumption is up to 100%.

Solution: use the standard channel as a sleep marker.

Related issue(s)

#20

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
  • Public contracts

    • My changes doesn't break project license.

Stylistic guide (mandatory)

  • My code complies with the styles guide.

  • My commit history is clean (only contains changes relating to my
    issue/pull request and no reverted-my-earlier-commit changes) and commit
    messages start with identifiers of related issues in square brackets.

    Example: [#42] Short commit description

    If necessary both of these can be achieved even after the commits have been
    made/pushed using rebase and squash.

Before merging (mandatory)

  • Check target branch of PR is set correctly

@codecov-commenter
Copy link

Codecov Report

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

Comparison is base (f1b9436) 82.64% compared to head (cdc83fb) 81.06%.
Report is 4 commits behind head on main.

Files Patch % Lines
cache.go 52.17% 19 Missing and 3 partials ⚠️
internal/queue/mpsc.go 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
- Coverage   82.64%   81.06%   -1.59%     
==========================================
  Files           9        9              
  Lines         657      713      +56     
==========================================
+ Hits          543      578      +35     
- Misses         99      119      +20     
- Partials       15       16       +1     

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

@maypok86 maypok86 merged commit 95e440d into main Dec 13, 2023
5 checks passed
@maypok86 maypok86 deleted the maypok86/#20-sleep-mpsc branch December 13, 2023 07:58
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