The php Function Pcntl_Signal_Dispatch
Signals are software interrupts that can be sent to a process by the operating system or other processes. They are a powerful way to manage processes and interact with the system at a lower level. The PCNTL library provides a number of functions to handle and send signals.
The pcntl_signal_dispatch() function installs new signal handlers for each pending signal. It then calls each of these signal handlers to deliver the corresponding signals. Returns TRUE on success or FALSE on failure.
pcntl_signal_get_handler() gets the current signal handler for the signal indicated by signo. The signal handler may be the name of a user created function or method or either of the global constants SIG_IGN or SIG_DFL. This handler will persist until you change it to something else, or your script ends.
pcntl_signal_waitpid() suspends execution of the calling process until a child as specified by pid exits. The pid is an integer value that identifies the process to wait for. The pid must be the child process of the main process (the parent process). When the child processes terminate, the process will exit properly and not leave zombies or other bad stuff behind. The pid can also be used to store status information that can be evaluated by other functions such as pcntl_wifexited(), pcntl_wifstopped() and pcntl_wexitstatus(). The pcntl_waitpid() function will return immediately if no children have exited. Otherwise it will wait for the first child whose process group ID is equal to the pid or until no more children are waiting to exit.