PHP Timeout Pattern Generator

•
45
•

Generates robust timeout infrastructure for PHP 8.4 applications to prevent indefinite execution and improve system resilience.

This skill automates the implementation of the Timeout design pattern within PHP 8.4 environments, providing a standardized framework for managing execution time limits across domain and infrastructure layers. It generates a comprehensive suite of components including immutable configuration objects, signal-based executors for CLI, stream-based executors for I/O operations, and PSR-15 middleware. By providing built-in fallback support and machine-readable exceptions, it enables developers to gracefully handle slow external APIs, long-running database queries, and intensive batch processing tasks while maintaining system stability.

Key Features

01Creates PSR-15 compatible middleware for managing timeouts in outgoing HTTP requests
02Generates PHP 8.4 immutable TimeoutConfig value objects with sub-second precision
0345 GitHub stars
04Supports customizable fallback strategies to provide degraded responses during timeouts
05Implements signal-based (pcntl) and stream-based timeout executors for CLI and FPM
06Produces automated unit tests for all generated domain and infrastructure components

Use Cases

01Managing individual item processing time limits within queue consumers and batch jobs
02Enforcing execution limits on complex database queries and large-scale file operations
03Protecting applications from blocking during slow third-party API or gRPC service calls