Functions whose direct use this boundary owns. */ public static function ownedFunctions(): array { return self::OWNED_FUNCTIONS; } /** * Whether every function the post-response signal budget needs exists. * * All three, not any: arming an alarm whose handler could not be installed * would leave a SIGALRM with the default disposition, which terminates the * process rather than ending the budget. */ public static function supportsSignalBudget(): bool { foreach (self::OWNED_FUNCTIONS as $function) { if (!ABJ_404_Solution_PhpRuntimeCapabilityAdapter::isFunctionAvailable($function)) { return false; } } return true; } /** Enable asynchronous signal dispatch when supported. */ public static function enableAsyncSignals(): bool { return ABJ_404_Solution_PhpRuntimeCapabilityAdapter::isFunctionAvailable('pcntl_async_signals') && pcntl_async_signals(true); } /** Install one signal handler when supported. */ public static function installSignalHandler(int $signal, callable $handler): bool { return ABJ_404_Solution_PhpRuntimeCapabilityAdapter::isFunctionAvailable('pcntl_signal') && pcntl_signal($signal, $handler); } /** Set or clear the process alarm; zero means unavailable or no prior alarm. */ public static function alarm(int $seconds): int { if (!ABJ_404_Solution_PhpRuntimeCapabilityAdapter::isFunctionAvailable('pcntl_alarm')) { return 0; } return pcntl_alarm($seconds); } }