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

[#533] Process callbacks in deadline_queue immediately on zero-timeout #539

Conversation

orecham
Copy link
Contributor

@orecham orecham commented Dec 3, 2024

Notes for Reviewer

Adds functionality to process all callbacks without waiting when providing a 0 timeout.

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Closes #533

@orecham orecham self-assigned this Dec 3, 2024
@orecham orecham force-pushed the iox2-533-zero-timeout-attachment-processes-callbacks-immediately branch from a5138e1 to 7245708 Compare December 3, 2024 02:08
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.12%. Comparing base (949d2e0) to head (56d6d5e).
Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2-bb/posix/src/deadline_queue.rs 84.61% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #539      +/-   ##
==========================================
- Coverage   79.13%   79.12%   -0.02%     
==========================================
  Files         202      202              
  Lines       24815    24824       +9     
==========================================
+ Hits        19638    19641       +3     
- Misses       5177     5183       +6     
Files with missing lines Coverage Δ
iceoryx2/src/port/waitset.rs 81.23% <100.00%> (ø)
iceoryx2-bb/posix/src/deadline_queue.rs 89.03% <84.61%> (-0.70%) ⬇️

... and 8 files with indirect coverage changes

@orecham orecham force-pushed the iox2-533-zero-timeout-attachment-processes-callbacks-immediately branch from 7245708 to d338238 Compare December 3, 2024 03:49
@orecham orecham force-pushed the iox2-533-zero-timeout-attachment-processes-callbacks-immediately branch from d338238 to 56d6d5e Compare December 3, 2024 03:50
return;
match attachment.period {
0 => {
if matches!(
Copy link
Contributor

Choose a reason for hiding this comment

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

It is just my personal opinion but I would prefer call(DeadlineQueueIndex(attachment.index)) == CallbackProgression::Stop over matches!(call(DeadlineQueueIndex(attachment.index)), CallbackProgression::Stop) just because it is for me just more intuitive.

And also my internal pattern matching in my head has much less to think about a line like if whatever == foo than if matches!(whatever, foo). Especially, when we have to deal with multiple languages like c, c++, rust and soon python or go.

So, I would prefer it the old way but I do not insist.

@orecham orecham merged commit b78746f into eclipse-iceoryx:main Dec 5, 2024
46 of 47 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.

Add timeout to WaitSet::wait_and_process_once()
2 participants