File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 66
77
88class 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
You can’t perform that action at this time.
0 commit comments