The worker side of workers (Effect's WorkerRunner).
A WorkerRunner[O, I] runs inside a worker: run(handler) tells the
parent the worker is ready, then calls handler(port_id, message) for
each I the parent sends, running the effect it returns (if any) on a
fiber of its own, until the parent closes the worker. send replies with
an O. WorkerRunnerPlatform starts the runner of the current
platform; python_worker_runner.layer is the one for Python threads and
child processes (Effect's NodeWorkerRunner).
Re-exports#
Types#
| Type | Definition | Description |
|---|---|---|
PlatformMessage | type PlatformMessage[I] = tuple[Literal[0], I] | tuple[Literal[1]] | What a parent sends its worker: |
Handler | type Handler = Callable[[int, Any], Effect[Any, Any, Any] | None] |