Skip to content

Commit 5b3f48a

Browse files
Amend documentation for a method in actor class
The previous documentation of the method `_run_loop()` was outdated and did not accurately describe the intention and behavior of the method. This update removes mention of the restart limit as it was primarily introduced for testing purposes and the actor should be always restarted in case of an unhandled exception. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 096b8b4 commit 5b3f48a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/frequenz/sdk/actor/_actor.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ async def _delay_if_restart(self, iteration: int) -> None:
7373
await asyncio.sleep(delay)
7474

7575
async def _run_loop(self) -> None:
76-
"""Run this actor's task in a loop until `_restart_limit` is reached.
76+
"""Run the actor's task continuously, managing restarts, cancellation, and termination.
77+
78+
This method handles the execution of the actor's task, including
79+
restarts for unhandled exceptions, cancellation, or normal termination.
7780
7881
Raises:
79-
asyncio.CancelledError: If this actor's `_run()` gets cancelled.
80-
Exception: If this actor's `_run()` raises any other `Exception` and reached
81-
the maximum number of restarts.
82-
BaseException: If this actor's `_run()` raises any other `BaseException`.
82+
asyncio.CancelledError: If the actor's `_run()` method is cancelled.
83+
Exception: If the actor's `_run()` method raises any other exception.
84+
BaseException: If the actor's `_run()` method raises any base exception.
8385
"""
8486
_logger.info("Actor %s: Started.", self)
8587
n_restarts = 0

0 commit comments

Comments
 (0)