Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108255 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68718 invoked from network); 26 Jan 2020 23:39:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Jan 2020 23:39:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CCEC01804D1 for ; Sun, 26 Jan 2020 13:49:51 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 26 Jan 2020 13:49:51 -0800 (PST) Received: by mail-yb1-f178.google.com with SMTP id z15so4027985ybm.8 for ; Sun, 26 Jan 2020 13:49:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eyp5ATzggnpDRatJr2LW7zJW+jQA/FMxNx9OEBHd6l4=; b=psYxiGKLg7Ueo7pSdh2talKvR8IlOHc2E4ZojEFzZa4iUNmJUEgkOS0q/d4OSh+Wkz wlqSAzlMZD7QqbSda5+FDzeFd8kP8OSpDaKRskDDuYIQUaLirAy1DNBEbwaPXKlEmfqn /rHq19BmsHDLCEOGyE6lobBv/OJRHoqnxRxMoEmrvICPAqIaXAdAPJFrHtHNYNaok8Dk BWbQsZEV2dwoBysFbzqau/5BRuqeKvuXqNf5JKa/Cuj29Pm5xg2fbyB0oTUwEgyItxfn ZS3QuYUBucyHuutdigXOQ+6DPk3MLqBdZz558649OVb+aqLT4j+ksghnBYUePgU7k5Iq lP3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eyp5ATzggnpDRatJr2LW7zJW+jQA/FMxNx9OEBHd6l4=; b=WIo1w/9apLNgvBM8l7akj8sCT3nhm7br38XNOOwp8D22gIdPBRtaGuTQVz9GTZNkL/ ChFQc5Dgd8xOteJwFkCrFSdCHDFcthfSy/FWLe2/AJeNm0viUXpn03nD8770zyp1UBxA nGi+g23AbLX0N+3/s9OfIuvl/ZAFRviT14pG2KXF0+JP68GAaIkRpRWzsJBXHvCstTqS Ki4P3BRQtqgRbnmw6BNLjXHs4LGdJL5Ys0r4QSCzRKgoNN+OPU+XNMBypx6E/uARV6C7 /LnFyDYL655/UOx4HlA2uB9NGz3IleFXAezF7afsVEm/npPXT3Jxp6BcMcn1iCI9AXMu SDbw== X-Gm-Message-State: APjAAAWSz7e5bz2RB2Ej4ScFBVHdyBqSxGvyTKBZjEKZ6JGty8vNQJG7 b0reAe0q+K3E7zcUdTn9DxN5IQ== X-Google-Smtp-Source: APXvYqzc9JvBed/UXp2grEzTTZnodNSfFCtj10yCtNMs+emtxSy4dPzydR+GGa9hSbYCEp+P6kkj7Q== X-Received: by 2002:a25:8241:: with SMTP id d1mr9920348ybn.394.1580075388916; Sun, 26 Jan 2020 13:49:48 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:906c:dba8:4ea6:d7a3? ([2601:c0:c680:5cc0:906c:dba8:4ea6:d7a3]) by smtp.gmail.com with ESMTPSA id t140sm5682735ywe.28.2020.01.26.13.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jan 2020 13:49:48 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Sun, 26 Jan 2020 16:49:47 -0500 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <98A11C8F-6B51-4774-A2F6-6B6C7311180B@newclarity.net> References: <3ca6d665-1a4f-8f7a-c82a-2e899f2e8df1@gmail.com> <44ba543d-b6eb-888b-9ed5-0f1e9d3b53b9@gmail.com> <8E382251-AE41-4BD9-A5F8-135D11B9E10D@newclarity.net> To: Rowan Tommins X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] Add viable long running execution model to php 8 From: mike@newclarity.net (Mike Schinkel) > On Jan 26, 2020, at 4:31 PM, Rowan Tommins = wrote: >=20 > It's not about timing out, as such, it's about starting with a fresh = state each time a request comes in from the web server. So the = long-running script can't just "opt out of time outs", it's got to be = launched by something other than a request - in existing = implementations, it's basically started as a command-line script, and = then handles the networking itself. Other than an assumption that we would use the same infrastructure we = have for existing PHP requests, which is not an assumption I am making, = why is it not technically possible to have an HTTP request be the = trigger vs. a command line script? The long running process actually = would return an HTTP status code letting the caller know if it was = started or not. Alternately an API called from a regular request could do the starting = of the long-running process. In that case we would of course need a regular request to be able to = restart the long-running script too via an API, if needed. Or even = terminate it. > In general, though, this is an interesting concept: keep each request = separate, but have a "master process" (initialised when the server = starts, or by something similar to a fork() call in a normal request) = that all requests can explicitly share things with. Yes. Thank you for acknowledging. > I'm not sure that would work well for Web Sockets, because it still = relies on the traditional request-response cycle, but I've never really = used them, so don't know what kind of architectural patterns make sense = for them. Considering the Swoole PHP extension (https://www.swoole.co.uk) the = long-running process would take the place of its functionality and new = apis to communicate with a long running process could allow = communication that resulted in regular requests being able to send = messages via the web socket server, and read queued messages from the = web socket server. =20 You won't be able to process notifications to clients via = request-response, but where that is needed it would be done by the = long-running process. So the request-response might "register" a = notification listener to the long-running process, for example. -Mike=