Skip to content

Commit fbd6735

Browse files
committed
Remove Service.tasks property
This is revealing too much internal information about how a service can be implemented, it makes more sense to expose it only to classes implementing a service, but not to service users. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent e763949 commit fbd6735

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/frequenz/core/asyncio/_service.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,6 @@ def start(self) -> None:
5959
def unique_id(self) -> str:
6060
"""The unique ID of this service."""
6161

62-
@property
63-
@abc.abstractmethod
64-
def tasks(self) -> collections.abc.Set[asyncio.Task[Any]]:
65-
"""The set of running tasks spawned by this service.
66-
67-
Users typically should not modify the tasks in the returned set and only use
68-
them for informational purposes.
69-
70-
Danger:
71-
Changing the returned tasks may lead to unexpected behavior, don't do it
72-
unless the class explicitly documents it is safe to do so.
73-
"""
74-
7562
@property
7663
@abc.abstractmethod
7764
def is_running(self) -> bool:
@@ -229,17 +216,8 @@ def unique_id(self) -> str:
229216
return self._unique_id
230217

231218
@property
232-
@override
233219
def tasks(self) -> collections.abc.Set[asyncio.Task[Any]]:
234-
"""The set of running tasks spawned by this service.
235-
236-
Users typically should not modify the tasks in the returned set and only use
237-
them for informational purposes.
238-
239-
Danger:
240-
Changing the returned tasks may lead to unexpected behavior, don't do it
241-
unless the class explicitly documents it is safe to do so.
242-
"""
220+
"""The set of running tasks spawned by this service."""
243221
return self._tasks
244222

245223
@property

0 commit comments

Comments
 (0)