set_detailed_state¶
- lsst.ts.scheduler.utils.set_detailed_state(detailed_state)¶
A class decorator for coroutine to facilitate setting/resetting detailed state.
- Parameters:
- detailed_state
DetailedState
Detailed state to switch to before awaiting the coroutine.
- detailed_state
Notes
When decorating a coroutine with
set_detailed_state
, you specify the associated detailed state and it will wrap the call withasync with detailed_state
context manager, causing it to switch to the provided detailed state before awaiting the coroutine and switching back to the previous detailed state when it is done.The
detailed_state
context manager will acquire a lock when setting the detailed state. The idea is that you can only execute one detailed state at a time so beware not to call a method that changes the detailed state from a another, to avoid dead locks.