45 $this->interruptCallback = $interruptCallback;
47 if(function_exists(
'sapi_windows_set_ctrl_handler')){
48 sapi_windows_set_ctrl_handler($this->interruptCallback =
function(
int $signo) use ($interruptCallback) :
void{
49 if($signo === PHP_WINDOWS_EVENT_CTRL_C || $signo === PHP_WINDOWS_EVENT_CTRL_BREAK){
53 }elseif(function_exists(
'pcntl_signal')){
59 pcntl_signal($signal, $this->interruptCallback = fn(
int $signo) => $interruptCallback());
61 pcntl_async_signals(
true);