Skip to content

Conversation

@ela-kotulska-frequenz
Copy link
Contributor

It works the same but is less low-level-ish.

It works the same but is less low-level-ish.

Signed-off-by: Elzbieta Kotulska <[email protected]>
@ela-kotulska-frequenz ela-kotulska-frequenz self-assigned this Jun 18, 2025
Copilot AI review requested due to automatic review settings June 18, 2025 08:32
@ela-kotulska-frequenz ela-kotulska-frequenz requested a review from a team as a code owner June 18, 2025 08:32
@ela-kotulska-frequenz ela-kotulska-frequenz added type:tech-debt Improves the project without visible changes for users cmd:skip-release-notes It is not necessary to update release notes for this PR labels Jun 18, 2025
@github-actions github-actions bot added the part:experimental Affects the experimental package label Jun 18, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the use of an asyncio.Future with an asyncio.Event in the NopReceiver implementation to simplify the code.

  • Replaces _ready_future with _close_event.
  • Updates the ready(), consume(), and close() methods accordingly.
Comments suppressed due to low confidence (1)

src/frequenz/channels/experimental/_nop_receiver.py:32

  • The ready() method now always returns False after waiting on the event, which might be non-intuitive. Consider adding a docstring note to clarify that this behavior is intentional in a no-operation receiver.
        if self._close_event.is_set():

@shsms
Copy link
Contributor

shsms commented Jun 18, 2025

I was worried Events might have spurious wakeups like condition variables, but that doesn't appear to be the case, according to the docs.

@llucax
Copy link
Contributor

llucax commented Jun 18, 2025

I was worried Events might have spurious wakeups like condition variables, but that doesn't appear to be the case, according to the docs.

I thought they are just a simple wrapper over a future, but apparently they are more complicated because they support multiple waiters.

@ela-kotulska-frequenz ela-kotulska-frequenz added this pull request to the merge queue Jun 20, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit 4d0ee05 Jun 20, 2025
7 checks passed
@ela-kotulska-frequenz ela-kotulska-frequenz deleted the improve_nop branch June 20, 2025 08:10
@llucax llucax added this to the v1.10.0 milestone Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:experimental Affects the experimental package type:tech-debt Improves the project without visible changes for users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants