This method defines the job that the node should do for each input item. A item obtained from the input queue is passed as arguments to this method, and the result is placed in the output queue. The method is executed concurrently with other nodes.
(self, *args, **kwargs)
| 152 | |
| 153 | @abstractmethod |
| 154 | def work(self, *args, **kwargs) -> Union[Any, Dict[str, Any]]: |
| 155 | """ |
| 156 | This method defines the job that the node should do for each input item. |
| 157 | A item obtained from the input queue is passed as arguments to this method, and the result is placed in the output queue. |
| 158 | The method is executed concurrently with other nodes. |
| 159 | """ |
| 160 | pass |
| 161 | |
| 162 | def _loop_fn(self, input: Queue, output: Queue, terminate_flag: Event): |
| 163 | self.init() |