webstation-broker
DeveloperPython referenceemulators

emulators.base

Emulator interface and shared launch plumbing.

Emulator interface and shared launch plumbing.

Defines the Emulator base class every launcher in this package subclasses, the environment apps are launched into, and the on-disk pid record that lets a broker process kill an emulator it never spawned.

attributelog
= logging.getLogger(__name__)
attributeXDG_RUNTIME_DIR
= os.environ.get('XDG_RUNTIME_DIR', '/config/.XDG')

The session's runtime directory, from XDG_RUNTIME_DIR (default /config/.XDG).

attributePID_FILE
= Path(os.environ.get('BROKER_PID_FILE', '/config/broker-emulator.json'))

Where the running emulator's pid is recorded, from BROKER_PID_FILE.

Defaults to /config/broker-emulator.json. The record exists so the emulator can still be killed by a broker process that never spawned it. Emulators are started in their own session, so nothing else ties them to the broker: a broker restart (an s6 bounce, or uvicorn --reload picking up an edit mid-session) otherwise leaves one playing with no handle on it, and the next launch stacks a second emulator on top of the first.