Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2019 invoked from network); 27 Jul 2008 14:05:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2008 14:05:05 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.94.239.7 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.7 mail.jdi-ict.nl Linux 2.6 Received: from [82.94.239.7] ([82.94.239.7:33329] helo=mail.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/15-02589-F808C884 for ; Sun, 27 Jul 2008 10:05:04 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id m6RE4wq7016193; Sun, 27 Jul 2008 16:04:58 +0200 Date: Sun, 27 Jul 2008 16:04:58 +0200 (CEST) X-X-Sender: derick@kossu.ez.no To: Arnaud Le Blanc cc: internals@lists.php.net In-Reply-To: <200807271551.30949.arnaud.lb@gmail.com> Message-ID: References: <200807271551.30949.arnaud.lb@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Subject: Re: [PHP-DEV] Replacement to ticks for signals From: derick@php.net (Derick Rethans) On Sun, 27 Jul 2008, Arnaud Le Blanc wrote: > Hi, > > I made a pcntl_signal_dispatch() function [1] to allow scripts that use > signals to work without ticks. > > This function just calls the pcntl's tick handler on-demand so that all signal > handler functions are called if there are pending signals. > > It does not allow the signal handlers to be called at any time like with > ticks, but allows things like this: > > while (do_something()) { > /* main loop */ > pcntl_signal_dispatch(); > } > > or > > while (pcntl_signal_dispatch() && do_something()) { > /* main loop */ > } Does the function block if there are no pending signals? If not, I think we should make that an option. regards, Derick -- HEAD before 5_3!: http://tinyurl.com/6d2esb http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org