GitHub

python_worker_runner

API reference for python_worker_runner.

The worker side of Python workers (Effect's NodeWorkerRunner).

layer provides the WorkerRunnerPlatform for code running in a ThreadWorker or a ProcessWorker: its runner tells the parent it is ready, calls the handler for each message the parent sends (with port id 0), sends replies back, and ends its run when the parent closes it (or, in a process, goes away). Outside a worker, start fails with a WorkerSpawnError. A worker's main program is typically::

fx.run_blocking_exit(MainLayer.launch())

which ends once the parent closes the worker.

Values

AttributeTypeDescription
layerLayer[WorkerRunnerPlatform]

The WorkerRunnerPlatform of the thread or process worker this code runs in.