Skip to content

Commit b00ab7d

Browse files
committed
Add link to the actor module documentation
To be able to use the `Actor` class and `run()` function there is a lot to have in mind that is hard to explain (without a lot of duplication) in each docstring. Because of this we just add an information box suggesting users to read the module-level documentation. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 4b48355 commit b00ab7d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/frequenz/sdk/actor/_actor.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515
class Actor(BackgroundService, abc.ABC):
1616
"""A primitive unit of computation that runs autonomously.
1717
18-
To implement an actor, subclasses must implement the `_run()` method, which should
19-
run the actor's logic. The `_run()` method is called by the base class when the
20-
actor is started, and is expected to run until the actor is stopped.
18+
To implement an actor, subclasses must implement the
19+
[`_run()`][frequenz.sdk.actor--the-_run-method] method, which should run the actor's
20+
logic. The [`_run()`][frequenz.sdk.actor--the-_run-method] method is called by the
21+
base class when the actor is started, and is expected to run until the actor is
22+
stopped.
2123
24+
!!! info
25+
26+
Please read the [`actor` module documentation][frequenz.sdk.actor] for more
27+
comprehensive guide on how to use and implement actors properly.
2228
"""
2329

2430
_restart_limit: int | None = None

src/frequenz/sdk/actor/_run_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
async def run(*actors: Actor) -> None:
1616
"""Await the completion of all actors.
1717
18+
!!! info
19+
20+
Please read the [`actor` module documentation][frequenz.sdk.actor] for more
21+
comprehensive guide on how to use and implement actors properly.
22+
1823
Args:
1924
*actors: the actors to be awaited.
2025
"""

0 commit comments

Comments
 (0)