CommandInfo¶
- class lsst.ts.salobj.topics.CommandInfo(remote_command: RemoteCommand, seq_num: int, wait_done: bool)¶
Bases:
object
Struct 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.
- remote_command
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: AckCmdDataType) bool ¶
Add a command acknowledgement to the queue.
- Parameters:
- ackcmd
SalInfo.AckCmdType
Command acknowledgement message.
- ackcmd
- Returns:
- isdone
bool
True if this is a final acknowledgement.
- isdone
- async next_ackcmd(timeout: float = 3600) AckCmdDataType ¶
Get next command acknowledgement of interest.
If
wait_done
true 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 use
DEFAULT_TIMEOUT
. This time limit is for the command to finish, ifwait_done
is true, else it is for the next command acknowledgement. If the command is acknowledged withCMD_INPROGRESS
then 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_INPROGRESS
acknowledgement with a reasonabletimeout
value.
- timeout
- Returns:
- ackcmd
SalInfo.AckCmdType
Command acknowledgement.
- ackcmd
- Raises:
- lsst.ts.salobj.AckError
If the command fails.
- lsst.ts.salobj.AckTimeoutError
If the command acknowledgement does not arrive in time.