CommandInfo#
- class lsst.ts.salobj.topics.CommandInfo(remote_command, seq_num, wait_done)#
Bases:
objectStruct to hold information about a command.
- Parameters:
remote_command (
RemoteCommand) – Remote command.seq_num (
int) – Sequence number of command.wait_done (
bool) – Wait until the command is done to finish the task? If false then wait for the next ack instead.
Methods Summary
add_ackcmd(ackcmd)Add a command acknowledgement to the queue.
close()Stop pending tasks.
next_ackcmd([timeout])Get next command acknowledgement of interest.
Methods Documentation
- add_ackcmd(ackcmd)#
Add a command acknowledgement to the queue.
- Parameters:
ackcmd (
SalInfo.AckCmdType) – Command acknowledgement message.- Returns:
isdone – True if this is a final acknowledgement.
- Return type:
- async next_ackcmd(timeout=3600)#
Get next command acknowledgement of interest.
If
wait_donetrue then return the final command acknowledgement, else return the next command acknowledgement. If the ackcmd is an error then raiseAckError. If waiting times out then raiseAckTimeoutError.- Parameters:
timeout (
float, optional) – Time limit, in seconds. If None then useDEFAULT_TIMEOUT. This time limit is for the command to finish, ifwait_doneis true, else it is for the next command acknowledgement. If the command is acknowledged withCMD_INPROGRESSthen the timeout is extended by the timeout value in the acknowledgement. Thus a slow command will not need a long timeout, so long as the command issues aCMD_INPROGRESSacknowledgement with a reasonabletimeoutvalue.- Returns:
ackcmd – Command acknowledgement.
- Return type:
SalInfo.AckCmdType- Raises:
AckError – If the command fails.
AckTimeoutError – If the command acknowledgement does not arrive in time.