runmanager.compile_multishot_async

runmanager.compile_multishot_async(labscript_file, run_files, stream_port=None, done_callback=None)[source]

Compiles labscript_file with multiple run_files (ie globals).

This function is designed to be called in a thread. The stdout and stderr from the compilation will be shovelled into stream_port via zmq push as it spews forth, and when each compilation is complete, done_callback will be called with a boolean argument indicating success. Compilation will stop after the first failure. If you want to receive the data on a zmq socket, do so using a PULL socket created from a labscript_utils.ls_zprocess.Context, or using a labscript_utils.ls_zprocess.ZMQServer. These subclasses will also be configured with the appropriate security settings and will be able to receive the messages.

Parameters:
  • labscript_file (str) – Path to labscript file to be compiled

  • run_files (list of str) – Paths to h5 file where compilation output is stored. These files must already exist with proper globals initialization.

  • stream_port (zmq.socket, optional) – ZMQ socket to push stdout and stderr. If None, defaults to calling process stdout/stderr. Default is None.

  • done_callback (function, optional) – Callback function run when compilation finishes. Takes a single boolean argument marking compilation success or failure. If None, callback is skipped. Default is None.