Source: src/cwsandbox/init.py:176
Wait for waitables to complete, return (done, pending).
Each waitable type has natural “wait for” behavior:
-
Sandbox: waits until RUNNING status
-
OperationRef: waits until operation completes
-
Process: waits until process completes
Parameters
-
waitables (Sequence[Waitable]): Sequence of Sandbox, OperationRef, or Process objects.
-
num_returns (int | None): If specified, return after this many complete. If None, wait for all to complete.
-
timeout (float | None): Maximum seconds to wait. If None, wait forever.
Returns
tuple[list[Waitable], list[Waitable]]: Tuple of (done, pending) lists containing the original waitable objects.
Raises
ValueError: If num_returns is less than 1.
Examples
Wait for all sandboxes to be running:
Wait for first 2 operations to complete:
Wait with timeout:
Last modified on September 17, 2026