Used to publish data both on CII pub-sub, and also to OLDB.
More...
|
| def | __init__ (self, logger, malpub=None, use_malpub=True) |
| | Constructor.
|
| |
| def | create_data_entity (self) |
| | Creates a data entity from the current publisher.
|
| |
| def | add_observer (self, callback) |
| | Accepts the callback functions without user timestamp (internal timestamping)
|
| |
| def | publish (self, entity, timeout_ms=1000) |
| | Publishes the given entity in pubSub and Oldb.
|
| |
Used to publish data both on CII pub-sub, and also to OLDB.
◆ __init__()
| def utils.observable_publisher.ObservablePublisher.__init__ |
( |
|
self, |
|
|
|
logger, |
|
|
|
malpub = None, |
|
|
|
use_malpub = True |
|
) |
| |
Constructor.
- Parameters
-
| malpub | The MAL publisher to which we delegate. :parm use_malpub: If false, then malpub does not get used for publishing, but possibly still in method createDataEntity(). The idea is to suppress publishing in certain cases, where still ObservablePublisher should be used. |
◆ add_observer()
| def utils.observable_publisher.ObservablePublisher.add_observer |
( |
|
self, |
|
|
|
callback |
|
) |
| |
Accepts the callback functions without user timestamp (internal timestamping)
- Parameters
-
| callback | callback function that should accept one entity of the same type of current publisher |
◆ create_data_entity()
| def utils.observable_publisher.ObservablePublisher.create_data_entity |
( |
|
self | ) |
|
Creates a data entity from the current publisher.
◆ publish()
| def utils.observable_publisher.ObservablePublisher.publish |
( |
|
self, |
|
|
|
entity, |
|
|
|
timeout_ms = 1000 |
|
) |
| |
Publishes the given entity in pubSub and Oldb.
It will skip pubSub publishing if either malpub or use_malpub is None or false respectively.
- Parameters
-
| entity | the entity containing the information to publish |
| timeout_ms | the timeout in milliseconds for the pubSub |
◆ logger
| utils.observable_publisher.ObservablePublisher.logger |
◆ malpub
| utils.observable_publisher.ObservablePublisher.malpub |
◆ observers
| utils.observable_publisher.ObservablePublisher.observers |
◆ use_malpub
| utils.observable_publisher.ObservablePublisher.use_malpub |
The documentation for this class was generated from the following file: