Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65854 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78789 invoked from network); 15 Feb 2013 06:48:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2013 06:48:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.52 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.215.52 mail-la0-f52.google.com Received: from [209.85.215.52] ([209.85.215.52:43328] helo=mail-la0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/00-13024-94ADD115 for ; Fri, 15 Feb 2013 01:48:41 -0500 Received: by mail-la0-f52.google.com with SMTP id fs12so3006461lab.25 for ; Thu, 14 Feb 2013 22:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=LxmFBdZjNfCY8q0V94L5b2cFkqC7/PhlpyCAzMYojWA=; b=divBBGWEQWbvZuZGCHEcqib7K53swrUyad6uHiVAEty8hR6C7APdCICkgveMsykY0D dnm87K+0kaKaciNycond+Zc2qI7z/XGBkwuWH9vqTJw7Pg7zQQDn7iE0mb9H8HEFOWDw Lx8QNcBqtu3KtBsk2gHfwTOeBgzEcqAdDPY6JxhRkd4v6bVJzH1jlzWIb8shJeb9epiK VFlmWj0Lk/8toPMW92p6U49Ive1L4rt+/I2ZJ+5KVQC755z7ykYAQg2lkPPIi1iYmWz8 5cQpQTEjO7AgyTDg+WGVso87oMZylqkZoVQL/cum1+iT/E+p/gTFcNXjU4dy5bVscV4z mY3Q== MIME-Version: 1.0 X-Received: by 10.152.109.146 with SMTP id hs18mr1246907lab.8.1360910482423; Thu, 14 Feb 2013 22:41:22 -0800 (PST) Received: by 10.112.38.199 with HTTP; Thu, 14 Feb 2013 22:41:22 -0800 (PST) In-Reply-To: <713003612.20130214164753@cypressintegrated.com> References: <511CEEB1.7040303@hoa-project.net> <511D5924.4070602@sugarcrm.com> <713003612.20130214164753@cypressintegrated.com> Date: Fri, 15 Feb 2013 07:41:22 +0100 Message-ID: To: Sanford Whiteman Cc: Stas Malyshev Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] File system watcher/monitoring From: pierre.php@gmail.com (Pierre Joye) hi, On Thu, Feb 14, 2013 at 10:47 PM, Sanford Whiteman wrote: >> I think it'd be great to have a library with unified interface and an >> extension that uses it. However, I'm not sure if these libraries are >> useful in common php use case - short-lived requests. Could I get the >> changes since the last request? Or is it useful only for long-running >> persistent processes? > > You're right of course that you are implicitly lengthening a request. > But if you are already embracing a long-polling model that waits for > filesystem changes, the back-end service can actually use fs events > instead of looping -- much more efficient. In fact I do this already > on Windows by running an external FileSystemWatcher EXE and waiting > for it to return (+ a timeout in the wrapper). There are native APIs for that (read: non .net, aka C) on Windows, using an external process for this purpose would be horrible, in all possible ways. Cheers, -- Pierre @pierrejoye