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_commandRemoteCommand

Remote command.

seq_numint

Sequence number of command.

wait_donebool

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: AckCmdDataType) bool

Add a command acknowledgement to the queue.

Parameters
ackcmdSalInfo.AckCmdType

Command acknowledgement message.

Returns
isdonebool

True if this is a final acknowledgement.

close() None

Stop pending tasks.

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 raise AckError. If waiting times out then raise AckTimeoutError.

Parameters
timeoutfloat, optional

Time limit, in seconds. If None then use DEFAULT_TIMEOUT. This time limit is for the command to finish, if wait_done is true, else it is for the next command acknowledgement. If the command is acknowledged with CMD_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 a CMD_INPROGRESS acknowledgement with a reasonable timeout value.

Returns
ackcmdSalInfo.AckCmdType

Command acknowledgement.

Raises
lsst.ts.salobj.AckError

If the command fails.

lsst.ts.salobj.AckTimeoutError

If the command acknowledgement does not arrive in time.