hlcc 2.0.0-beta2+pre1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
utils.observable_publisher.ObservablePublisher Class Reference

Used to publish data both on CII pub-sub, and also to OLDB. More...

Public Member Functions

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.
 

Public Attributes

 logger
 
 malpub
 
 use_malpub
 
 observers
 

Detailed Description

Used to publish data both on CII pub-sub, and also to OLDB.

Constructor & Destructor Documentation

◆ __init__()

def utils.observable_publisher.ObservablePublisher.__init__ (   self,
  logger,
  malpub = None,
  use_malpub = True 
)

Constructor.

Parameters
malpubThe 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.

Member Function Documentation

◆ add_observer()

def utils.observable_publisher.ObservablePublisher.add_observer (   self,
  callback 
)

Accepts the callback functions without user timestamp (internal timestamping)

Parameters
callbackcallback 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
entitythe entity containing the information to publish
timeout_msthe timeout in milliseconds for the pubSub

Member Data Documentation

◆ 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: