tinker_cookbook.sandbox.ModalSandboxPool
class tinker_cookbook.sandbox.ModalSandboxPool(**)
Pool of Modal sandboxes for concurrent execution.
run_in_workdir(files, command, timeout)
Execute command with files using an available sandbox from the pool.
Parameters:
- files (dict[str, str]) – Files to write {filename: content}
- command (list[str]) – Command and arguments (e.g., ["python", "run.py"])
- timeout (int | None) – Execution timeout in seconds
terminate()
Exit the pool and terminate all sandboxes.