pipert.core.message¶
Module Contents¶
Classes¶
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Functions¶
|
Encodes the message object. |
|
Decodes the message object. |
-
class
pipert.core.message.Payload(data)[source]¶ Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
-
class
pipert.core.message.FramePayload(data)[source]¶ Bases:
pipert.core.message.PayloadHelper class that provides a standard way to create an ABC using inheritance.
-
class
pipert.core.message.PredictionPayload(data)[source]¶ Bases:
pipert.core.message.PayloadHelper class that provides a standard way to create an ABC using inheritance.
-
class
pipert.core.message.FrameMetadataPayload(data)[source]¶ Bases:
pipert.core.message.PayloadHelper class that provides a standard way to create an ABC using inheritance.
-
class
pipert.core.message.Message(data, source_address)[source]¶ -
-
record_entry(self, component_name, logger)[source]¶ Records the timestamp of the message’s entry into a component.
- Args:
component_name: the name of the component that the message entered. logger: the logger object of the component’s input routine.
-
record_custom(self, component_name, section)[source]¶ Records the timestamp of the message’s entry into some section of a component.
- Args:
component_name: the name of the component that the message is in. section: the name of the section within the component that the message entered.
-
record_exit(self, component_name, logger)[source]¶ Records the timestamp of the message’s exit out of a component. Additionally, it enables a flag called ‘reached_exit’ if the message is exiting the pipeline’s “output component”.
- Args:
component_name: the name of the component that the message exited. logger: the logger object of the component’s output routine.
-
get_latency(self, component_name)[source]¶ Returns the time it took for a message to pass through a whole component.
Using the message’s history, this method calculates and returns the amount of time that passed from the moment the message entered a component, to the moment that it left it. Args:
component_name: the name of the relevant component.
-
-
pipert.core.message.message_encode(msg, generator=None)[source]¶ Encodes the message object.
This method compresses the message payload and then serializes the whole message object into bytes, using pickle.
- Args:
msg: the message to encode. generator: generator necessary for shared memory usage.
-
pipert.core.message.message_decode(encoded_msg, lazy=False)[source]¶ Decodes the message object.
This method deserializes the pickled message, and decodes the message payload if ‘lazy’ is False.
- Args:
encoded_msg: the message to decode. lazy: if this is True, then the payload will only be decoded once it’s accessed.