eta_nexus.subscription_handlers.subscription_handler module

class eta_nexus.subscription_handlers.subscription_handler.SubscriptionHandler(write_interval: TimeStep = 1)[source]

Bases: ABC

Subscription handlers do stuff to subscribed data points after they are received. Every handler must have a push method which can be called when data is received.

Parameters:

write_interval – Interval for writing data to csv file.

abstract push(node: Node, value: Any, timestamp: datetime | None = None) None[source]

Receive data from a subscription. This should contain the node that was requested, a value and a timestamp when data was received. If the timestamp is not provided, current time will be used.

Parameters:
  • node – Node object the data belongs to.

  • value – Value of the data.

  • timestamp – Timestamp of receiving the data.