BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

FAQ: stop the RE and immediately return to idle? #183

Open prjemian opened 1 year ago

prjemian commented 1 year ago

Is there a suspender that will stop the RE and immediately return to idle?

prjemian commented 1 year ago

This question was answered as an apstools issue comment. Post this question and answer as a FAQ:

Q: Is there a suspender to stop RE and return to idle?

A: A suspender is not used for this. A bluesky suspender watches a signal and suspends Msg processing by the RunEngine. The user can choose to change the RunEngine's state at that time. Processing resumes when the signal becomes valid again.

There are two RunEngine methods of particular interest:

method description
RunEngine.request_pause Command the Run Engine to pause.
RunEngine.request_suspend Request that the run suspend itself until the future is finished.

Neither of these return the RunEngine to idle.

If you absolutely must stop the RunEngine from within a plan, yet do it gracefully, abort_run_engine_to_idle() is the plan for you. See the notebook for its definition.

You are cautioned against the general use of this plan. We choose not to include it directly in the apstools library.

prjemian commented 1 year ago

See:

prjemian commented 1 year ago

Given the number of related issues, this topic might benefit from both a FAQ and a document.

prjemian commented 1 year ago