mosaik.process_termination_managers — control how cmd simulations terminate

class ProcessTerminationManager(*args, **kwargs)[source]

A protocal for coroutines that can terminate an asyncio.subprocess.Process.

See mosaik.process_termination_managers for predefined termination managers.

async keep_running(process)[source]

Do not attempt to terminate the process. (It might keep running depending on the operating system and the way that it was created.)

Parameters:

process (Process)

class auto_terminate(timeout=None)[source]

Instances of this class terminate a process by sending it a terminate signal, then wait for it timeout seconds (or indefinitely if timeout=None.

Note: This needs to be instanciated to get a ProcessTerminationManager.

Parameters:

timeout (float | None)