ecal.core.subscriber module

Module that contains the ecal message subscriber interface.

class ecal.core.subscriber.MessageSubscriber(name, topic_type='')

Bases: object

Message subscriber - Base class for all specialized subscribers Classes inheriting from this class need to implement the receive(), set_callback() and rem_callback() functions.

receive(timeout=0)

receive subscriber content with timeout

Parameters

timeout (int) – receive timeout in ms

rem_callback(callback)

remove callback function for incoming messages

Parameters

callback – python callback function (f(topic_name, msg, time))

set_callback(callback)

set callback function for incoming messages

Parameters

callback – python callback function (f(topic_name, msg, time))

set_qos_historykind(qpolicy, depth)

set quality of service historykind mode and depth

Parameters
  • qpolicy – 0 = keep_last_history_qos, 1 = keep_all_history_qos

  • depth – history kind buffer depth

set_qos_reliability(topic_handle, qpolicy)

set quality of service reliability mode

Parameters

qpolicy – 0 = best_effort_reliability_qos, 1 = reliable_reliability_qos

class ecal.core.subscriber.ProtoSubscriber(name, type_protobuf)

Bases: ecal.core.subscriber.MessageSubscriber

Spezialized subscriber that subscribes to protobuf messages

receive(timeout=0)

receive subscriber content with timeout

Parameters

timeout (int) – receive timeout in ms

rem_callback(callback)

remove callback function for incoming messages

Parameters

callback – python callback function (f(topic_name, msg, time))

set_callback(callback)

set callback function for incoming messages

Parameters

callback – python callback function (f(topic_name, msg, time))

class ecal.core.subscriber.StringSubscriber(name)

Bases: ecal.core.subscriber.MessageSubscriber

Spezialized publisher subscribes to plain strings

receive(timeout=0)

receive subscriber content with timeout

Parameters

timeout – receive timeout in ms

rem_callback(callback)

remove callback function for incoming messages

Parameters

callback – python callback function (f(topic_name, msg, time))

set_callback(callback)

set callback function for incoming messages

Parameters

callback – python callback function (f(topic_name, msg, time))