MultiProcessRuntime

class lightning.app.runners.multiprocess.MultiProcessRuntime(app=None, entrypoint=None, start_server=True, host='http://127.0.0.1', port=7501, processes=<factory>, threads=<factory>, work_runners=<factory>, done=False, backend='multiprocessing', env_vars=<factory>, secrets=<factory>, run_app_comment_commands=False, enable_basic_auth='', _has_triggered_termination=False)[source]

Bases: Runtime

Runtime to launch the LightningApp into multiple processes.

The MultiProcessRuntime will generate 1 process for each LightningWork and attach queues to enable communication between the different processes.

dispatch(*args, open_ui=True, **kwargs)[source]

Method to dispatch and run the LightningApp.

terminate()[source]

This method is used to terminate all the objects (threads, processes, etc..) created by the app.