File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,14 @@ def _rec_update(self) -> bool:
181181 def _rec_update_process (self , data : Any ) -> bool :
182182 # Ensure data are valid
183183 if self ._validator is not None and not self ._validator .is_valid (data ):
184+ for s in self ._subscribers :
185+ s .on_invalid_data_received (data )
186+
184187 return False
185188
189+ for s in self ._subscribers :
190+ s .on_valid_data_received (data )
191+
186192 # Pass to decider
187193 return self .decider .process (data )
188194
Original file line number Diff line number Diff line change 77"""
88
99from abc import ABC , abstractmethod
10+ from typing import Any
1011
1112
1213class BoboEngineSubscriber (ABC ):
1314 """
1415 Engine subscriber interface.
1516 """
1617
18+ @abstractmethod
19+ def on_valid_data_received (self , data : Any ) -> None :
20+ """
21+ :param data: Valid data received by engine.
22+ """
23+
24+ @abstractmethod
25+ def on_invalid_data_received (self , data : Any ) -> None :
26+ """
27+ :param data: Invalid data received by engine.
28+ """
29+
1730
1831class BoboEnginePublisher (ABC ):
1932 """
You can’t perform that action at this time.
0 commit comments