morpheus.messages.control_message.ControlMessage#

class ControlMessage(*args, **kwargs)[source]#

Bases: MessageBase

Methods

get_metadata([key, default_value])

Return a given piece of metadata, if key is None return the entire metadata dictionary.

has_task(task_type)

Return True if the control message has at least one task of the given type

add_task

config

copy

filter_timestamp

get_tasks

get_timestamp

get_timestamps

has_metadata

list_metadata

payload

remove_task

set_metadata

set_timestamp

task_type

tensor_count

tensors

get_metadata(key=None, default_value=None)[source]#

Return a given piece of metadata, if key is None return the entire metadata dictionary. If key is not found, default_value is returned.

Parameters:
  • key (str) – The key of the metadata to retrieve, or None for all metadata

  • default_value (Any) – The value to return if the key is not found, ignored if key is None

Returns:

The value of the metadata key, or the entire metadata dictionary if key is None

Return type:

Any

has_task(task_type)[source]#

Return True if the control message has at least one task of the given type