CommandFutures

class lsst.ts.MTMount.CommandFutures

Bases: object

asyncio futures to track the progress of an Operation Manager command.

Notes

Attributes

  • ack: an asyncio.Future which is set to:
    • result=timeout (in sec) when the command is acknowledged (an Ack reply is read).
    • exception=`lsst.ts.salobj.ExpectedError` if the command fails (a NoAck reply is read) before the command is acknowledged.
  • done: an asyncio.Future which is set to:
    • result=`None` when the command finishes successfully (a Done reply is read).
    • exception=`lsst.ts.salobj.ExpectedError` if the command fails.

Attributes Summary

timeout Return the timeout, in seconds.

Methods Summary

setack(timeout) Report a command as started.
setdone() Report a command as done.
setnoack(explanation) Report a command as failed.

Attributes Documentation

timeout

Return the timeout, in seconds.

Return None if command not acknowledged. Raise an exception if the command failed before being acknowledged.

Methods Documentation

setack(timeout)

Report a command as started.

Parameters:
timeout : float

Max time for command to complete (sec).

setdone()

Report a command as done.

setnoack(explanation)

Report a command as failed.

Parameters:
explanation : str

Explanation of what went wrong.

Notes

Sets the ack (if not done) else done future to lsst.ts.salobj.ExpectedError exception.

Do not set both, to avoid “exception was never retrieved” warnings.