Skip to content

Commit c88eed1

Browse files
author
DUYN
committed
Add comments
1 parent fbfcae0 commit c88eed1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bot/workers/worker.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66

77

88
class Worker(Observable, ABC):
9+
"""
10+
Class Worker: manages the execution of a task and the context around executing it.
11+
"""
912

1013
def start(self, **kwargs: Dict[str, Any]) -> None:
14+
"""
15+
Function that will start the worker, and notify its observers when it is finished
16+
"""
1117
self.work(**kwargs)
1218
self.notify_observers()
1319

1420
@abstractmethod
1521
def work(self, **kwargs: Dict[str, Any]) -> None:
22+
"""
23+
Function that needs to be implemented by a concrete class.
24+
"""
1625
pass
1726

1827
def add_observer(self, observer: Observer) -> None:
@@ -23,4 +32,7 @@ def remove_observer(self, observer: Observer) -> None:
2332

2433
@abstractmethod
2534
def get_id(self) -> str:
35+
"""
36+
Function that needs to be implemented by a concrete class to identify the worker.
37+
"""
2638
pass

0 commit comments

Comments
 (0)