.. currentmodule:: bluesky.run_engine

RunEngine API Documentation
===========================

.. autoclass:: RunEngine

    .. automethod:: __call__

    The RunEngine maintains a callback registry of functions that receive any
    :doc:`documents` generated by plan execution. These methods add and remove
    functions from that registry.

    .. automethod:: subscribe
    .. automethod:: unsubscribe

    When the RunEngine is in a paused state, it can be resumed or stopped in
    :ref:`various ways <interactive_pause_summary>` using these methods:

    .. automethod:: resume
    .. automethod:: abort
    .. automethod:: stop
    .. automethod:: halt

    The RunEngine can suspend and resume plan execution in response to external
    changes. See :ref:`suspenders`.

    .. automethod:: install_suspender
    .. automethod:: remove_suspender
    .. automethod:: clear_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.

    .. automethod:: request_pause
    .. automethod:: request_suspend

    These methods may be used to register custom commands to supplement or
    replace the built-in commands recognized by the RunEngine.

    .. automethod:: register_command
    .. automethod:: unregister_command

    These methods may be used to list the commands available, or print
    a summary as to what they do.

    .. automethod:: print_command_registry
    .. autoattribute:: commands

A RunEngine encapsulates a :class:`Dispatcher` for emitting any
:doc:`documents` generated by plan execution. The methods
:meth:`RunEngine.subscribe` and :meth:`RunEngine.unsubscribe`, documented
above, are aliases to the corresponding methods on the RunEngine's Dispatcher.

.. autoclass:: Dispatcher

    .. automethod:: subscribe
    .. automethod:: unsubscribe
    .. automethod:: unsubscribe_all
    .. automethod:: process
