TMC Common EventReceiver

1. EventReceiver

The event_receiver has the responsibility to receive events from the sub devices managed by a TMC node.

class ska_tmc_common.v1.event_receiver.EventReceiver(component_manager, logger: <Mock id='133592104055904'>, attribute_list: dict[str, ~typing.Callable] | None = None, max_workers: int = 1, proxy_timeout: int = 500, event_subscription_check_period: int = 1)

The EventReceiver class has the responsibility to receive events from the sub devices managed by a TMC node. It subscribes to State, healthState attribute by default. To subscribe any additional attributes, the class should be sent an attribute_tobe_subscribed that contains the attribute names

TBD: what about scalability? what if we have 1000 devices?

start() None

Checks if device is alive

stop() None

Checks if device has stopped

run() None

The run method for the Event Receiver thread. Runs in a loop to subscribe events on the devices.

submit_task(device_info: DeviceInfo) None

Submits the task to the executor for the given device info object.

Parameters:

device_info (DeviceInfo) – DeviceInfo for the device on which events are to be subscribed.

Return type:

None

subscribe_events(dev_info: DeviceInfo, attribute_tobe_subscribed: list[str]) None

A method to subscribe to attribute events from lower level devices.

Parameters:
  • dev_info (DeviceInfo) – The device info object of the given device.

  • attribute_tobe_subscribed (list[str]) – A list containing the attributes to subscribe

Return type:

None

handle_health_state_event(event: tango.EventData) None

Submit healthState event to callback for processing thus making tango bus free for next event handling

handle_state_event(event: tango.EventData) None

Submit state event to callback for processing thus making tango bus free for next event handling

handle_obs_state_event(event: tango.EventType.CHANGE_EVENT) None

Submit obsState event to callback for processing thus making tango bus free for next event handling

handle_command_result_event(event: tango.EventType.CHANGE_EVENT) None

Submit longRunningCommandResult event to callback for processing thus making tango bus free for next event handling

handle_admin_mode_event(event: tango.EventType.CHANGE_EVENT) None

Submit adminMode event to callback for processing thus making tango bus free for next event handling

handle_dishvcc_event(event: tango.EventType.CHANGE_EVENT) None

Submit dishVccConfig event to callback for processing thus making tango bus free for next event handling

handle_source_dishvcc_config_event(event: tango.EventType.CHANGE_EVENT) None

Submit sourceDishVccConfig event to callback for processing thus making tango bus free for next event handling