Skip to content

Conversation

@ela-kotulska-frequenz
Copy link
Contributor

This is usefull if we have type: asyncio.Task | Actor and need to check if actor finished.

@ela-kotulska-frequenz ela-kotulska-frequenz self-assigned this Jun 3, 2025
@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 12:18
@ela-kotulska-frequenz ela-kotulska-frequenz requested a review from a team as a code owner June 3, 2025 12:18
@ela-kotulska-frequenz ela-kotulska-frequenz requested review from Marenz and removed request for a team June 3, 2025 12:18
@ela-kotulska-frequenz ela-kotulska-frequenz added type:enhancement New feature or enhancement visitble to users part:actor Affects an actor ot the actors utilities (decorator, etc.) labels Jun 3, 2025
@ela-kotulska-frequenz ela-kotulska-frequenz requested review from llucax and removed request for Marenz and Copilot June 3, 2025 12:18
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests labels Jun 3, 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 adds a new done() method to the BackgroundService to allow checking if all tasks have completed. It updates the BackgroundService implementation, adjusts tests to validate the new behavior, and documents the change in the release notes.

  • Added done() method in BackgroundService.
  • Updated tests to assert the correct done() states before, during, and after service execution.
  • Updated release notes to capture the new feature.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/actor/test_background_service.py Added assertions to validate the done() method's behavior in various execution scenarios.
src/frequenz/sdk/actor/_background_service.py Implemented the done() method that inverts the is_running status to indicate completion.
RELEASE_NOTES.md Documented the new done() method feature for BackgroundService.

This is usefull if we have type: `asyncio.Task | Actor`
and need to check if actor finished.

Signed-off-by: Elzbieta Kotulska <[email protected]>
@github-project-automation github-project-automation bot moved this from To do to Review approved in Python SDK Roadmap Jun 3, 2025
@github-project-automation github-project-automation bot moved this from Review approved to Done in Python SDK Roadmap Jun 3, 2025
@ela-kotulska-frequenz ela-kotulska-frequenz deleted the check_done branch June 11, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:actor Affects an actor ot the actors utilities (decorator, etc.) part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests type:enhancement New feature or enhancement visitble to users

Projects

Development

Successfully merging this pull request may close these issues.

2 participants