Skip to main content

resq_mcp.core.timeout

Centralized timeout configuration for ResQ MCP server. Provides consistent, env-var-configurable timeout values across all tools. Inspired by Archon MCP server timeout patterns. Environment variables: RESQ_REQUEST_TIMEOUT: Total request timeout in seconds (default: 30) RESQ_CONNECT_TIMEOUT: Connection timeout in seconds (default: 5) RESQ_READ_TIMEOUT: Read timeout in seconds (default: 20) RESQ_POLLING_BASE_INTERVAL: Base polling interval in seconds (default: 1) RESQ_POLLING_MAX_INTERVAL: Max polling interval in seconds (default: 5) RESQ_MAX_POLLING_ATTEMPTS: Max polling attempts (default: 30)

annotations

os

dataclass

TimeoutConfig Objects

@dataclass(frozen=True)
class TimeoutConfig()
Immutable timeout configuration.

total

connect

read

get_default_timeout

def get_default_timeout() -> TimeoutConfig
Get default timeout configuration from environment or defaults.

get_max_polling_attempts

def get_max_polling_attempts() -> int
Get maximum number of polling attempts.

get_polling_interval

def get_polling_interval(attempt: int) -> float
Get polling interval with exponential backoff. Arguments:
  • attempt - Current attempt number (0-based).
Returns: Sleep interval in seconds.