Tile Poll Management
This module implements polling management for a TileComponentManager.
- class RequestIterator
A class that returns attributes allowed given a TpmStatus.
- __init__()
Construct a instance of RequestIterator.
- calculate_stale_attributes(new_status)
Return a set of attribute that will no longer be polled.
- class TileLRCRequest(name, command_object, *args, publish=False, task_callback=None, **kwargs)
Class handling a Long Running Command request.
- __init__(name, command_object, *args, publish=False, task_callback=None, **kwargs)
Initialise a new LRC request for execution in a poll.
- Parameters:
name (
str) – Name of the command.command_object (
Any) – The object to callargs (
Any) – optional arguments to passpublish (
bool) – Whether to publish the results of poll to the TANGO device on poll_successtask_callback (
Optional[Callable]) – An optional callback to update with command status.kwargs (
Any) – Optional kwargs
- notify_failed(message='')
Notify task callback that this command is FAILED.
- notify_removed_from_queue()
Notify task callback that this command has been removed.
NOTE: Since we have just wiped this request it will never be picked up during a poll, we must abort the command. The client to the LRC will then see QUEUED -> ABORTED, and the command will never be executed.
- Return type:
- class TileRequest(name, command_object, *args, publish=False, **kwargs)
Class representing an action to be performed by a poll.
- __init__(name, command_object, *args, publish=False, **kwargs)
Initialise a new request for execution in a poll.
- class TileRequestProvider(stale_attribute_callback=None, _request_iterator=None)
A class that manages requests for the Tile.
It ensures that:
commands get executed as promptly as possible
only attributes allowed to be polled given a TpmStatus are returned.
- __init__(stale_attribute_callback=None, _request_iterator=None)
Initialise a new instance.
- Parameters:
stale_attribute_callback (
Optional[Callable]) – an optional callback to call with attributes no longer being updated._request_iterator (
Optional[RequestIterator]) – an optional RequestIterator to supply for testing.
- desire_configuration_read()
Register a request to read configuration from the TPM.
- Return type:
- enqueue_lrc(request, priority=999, wipe_time=None)
Register a request to be executed on the Tile.
- Parameters:
priority (
int) – The priority of the request. Lower number means higher priority.request (
TileLRCRequest) – The LRC request to execute on a poll.wipe_time (
Optional[float]) – the approx time at which to wipe this command.
- Return type: