note 115015 added to function.pcntl-signal-dispatch

From: Date: Tue, 13 May 2014 00:40:25 +0000
Subject: note 115015 added to function.pcntl-signal-dispatch
Groups: php.notes 
Request: Send a blank email to php-notes+get-199524@lists.php.net to get a copy of this message
As noted by "me at subsonic dot net" calling pcntl_signal_dispatch() from within a signal handler invoked by a previous pcntl_signal_dispatch() will not trigger handlers for any new pending signals. This seems to be true even if you pcntl_exec() a new PHP processor to execute an entirely different script. The solution seems to be to explicitly call pcntl_signal_dispatch()inside a ticks_handler() . And use sig_handler(int) as a push function to a queue. Immediately following the call to dispatch in the ticks_handler, pop your queue doing what you would have done in the signal_handler until the queue is empty. ---- Server IP: 216.194.115.244 Probable Submitter: 216.55.28.6 ---- Manual Page -- http://php.net/manual/en/function.pcntl-signal-dispatch.php Edit -- https://master.php.net/note/edit/115015 Del: integrated -- https://master.php.net/note/delete/115015/integrated Del: useless -- https://master.php.net/note/delete/115015/useless Del: bad code -- https://master.php.net/note/delete/115015/bad+code Del: spam -- https://master.php.net/note/delete/115015/spam Del: non-english -- https://master.php.net/note/delete/115015/non-english Del: in docs -- https://master.php.net/note/delete/115015/in+docs Del: other reasons-- https://master.php.net/note/delete/115015 Reject -- https://master.php.net/note/reject/115015 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#199524) next »