launcher()
Return a launcher spawning Python processes running pymizu.
Usage
launcher(
*,
python=None,
stdout=None,
stderr=None,
)Channel.create() calls it with token alone to spawn the peer; Pool.create() calls it with token and slot to spawn each worker. The process runs python -m pymizu.child <token> or python -m pymizu.worker <token> <slot>. This is the default of every launcher= argument, and the counterpart of the R package’s mizu_launcher().
Parameters
python: str | None = None-
Path to the Python interpreter; the default is
sys.executable. stdout: _Any = None-
Forwarded to
subprocess.Popen; the default inherits the console, where the peer’s error messages land. stderr: _Any = None-
Forwarded to
subprocess.Popen.
Returns
Acallable(token, slot=None)launcher for-
Channel.create()andPool.create().
Examples
import pymizu
with pymizu.Pool.create(
4, launcher=pymizu.launcher(stderr="worker.log")
) as pool:
print(pool.submit(abs, -1).collect())