butler/transport/interruptible_client_ops.py
Rama main · réplica de lectura del repositorio original.
"""Interruptible worker thread helpers (P0-A)."""
from __future__ import annotations
from typing import Any, Callable, TypeVar
T = TypeVar("T")
def run_interruptible_worker_safe(
fn: Callable[[], T],
result: dict[str, Any],
) -> None:
try:
result["value"] = fn()
except Exception as exc:
result["error"] = exc