RunEngine API Documentation¶
The RunEngine
¶
The Run Engine execute messages and emits Documents. |
The main user entry point tho the RunEngine is RE(my_plan(...))
Execute a plan. |
The RunEngine maintains a callback registry of functions that receive any Documents generated by plan execution. These methods add and remove functions from that registry.
Register a callback function to consume documents. |
|
Unregister a callback function its integer ID. |
When the RunEngine is in a paused state, it can be resumed or stopped in various ways using these methods:
Resume a paused plan from the last checkpoint. |
|
Stop a running or paused plan and mark it as aborted. |
|
Stop a running or paused plan, but mark it as successful (not aborted). |
|
Stop the running plan and do not allow the plan a chance to clean up. |
The RunEngine can suspend and resume plan execution in response to external changes. See Automated Suspension.
Install a ‘suspender’, which can suspend and resume execution. |
|
Uninstall a suspender. |
|
Uninstall all suspenders. |
These methods are used internally to pause or suspend the RunEngine. Typically the user accomplishes this with Ctrl+C or by installing suspenders, respectively. For special applicaitons, they can be called directly.
Command the Run Engine to pause. |
|
Request that the run suspend itself until the future is finished. |
These methods may be used to register custom commands to supplement or replace the built-in commands recognized by the RunEngine.
Register a new Message command. |
|
Unregister a Message command. |
These methods may be used to list the commands available, or print a summary as to what they do.
This conveniently prints the command registry of available commands. |
|
The list of commands available to Msg. |
A RunEngine encapsulates a Dispatcher
for emitting any
Documents generated by plan execution. The methods
RunEngine.subscribe()
and RunEngine.unsubscribe()
, documented
above, are aliases to the corresponding methods on the RunEngine’s Dispatcher.
The Dispatcher
¶
Dispatch documents to user-defined consumers on the main thread. |
|
Register a callback function to consume documents. |
|
Unregister a callback function using its integer ID. |
|
Unregister all callbacks from the dispatcher |
|
Dispatch document |
The RunBundler
¶
The RunEngine also creates RunBundlers instances to encapsulate the logic and book keeping for generating events (and allow multiple runs to be open at once). In general you should not be directly working with a RunBundler.
The co-routines for opening and closing a run.
Instruct the RunEngine to write the RunStop document |
The co-routines for opening / filling / closing / dropping an Event
Trigger the run engine to start bundling future obj.read() calls for |
|
Add a reading to the open event bundle. |
|
Drop the event that is currently being bundled |
|
Save the event that is currently being bundled |
The co-routines for managing flyers
Start a flyscan object. |
|
Tell a flyer, ‘stop collecting, whenever you are ready’. |
|
Collect data cached by a flyer and emit documents. |
|
The co-routines for changing a device configuration
Configure an object |
The co-routines for managing monitors
Monitor a signal. |
|
Stop monitoring; i.e., remove the callback emitting event documents. |
The co-routines for checkpoint management
The co-routines to record interruptions
Emit an event in the ‘interruptions’ event stream. |