Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122036 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89525 invoked from network); 25 Dec 2023 17:14:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Dec 2023 17:14:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5EE8C18004E for ; Mon, 25 Dec 2023 09:15:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 25 Dec 2023 09:15:17 -0800 (PST) Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-67f9fac086bso24909406d6.3 for ; Mon, 25 Dec 2023 09:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunglas-fr.20230601.gappssmtp.com; s=20230601; t=1703524492; x=1704129292; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1TUDz5lE13eSimM+xy/7yYDNS24XMX+v/Rro2iD2t7I=; b=QgTH7UeNhKSRKXFd5q8bJy98OSz/Dal4Tncc7WgOTyBlqUwxzAD72Uw52MaVQ+M+oF SDIRQLtuSnB2MNatnq45KVeI7/klnFx/o/69h2AFLXGzJM4WkxV3t7kNitZR/Xdazuds KgTRwVTgNImLsRNrRGEj7aEugn2m25uRFuAfeD5KjMqn/tYZ6jdJbHmIULOPqGV2cjJT rMgzuJR03ZKFEBmi6C5wDzSCEs4trHkcOFcmiXYvKeCOU/Ir6Ogs2JAFJmyAuGu9mc7l lgiPEGOkKZYEWlNZiOcrdXpArlT29yFvHNbNa8up2xAogOHRmaUJViZWe1H/xiEtLhw9 47jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703524492; x=1704129292; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1TUDz5lE13eSimM+xy/7yYDNS24XMX+v/Rro2iD2t7I=; b=d7KbCoiaArojOETsDzH8kInNEgLIzaHr/Cvk3ranVf8lBxKHaIvqORTqyNvKiws0qO BORNFX5QMxP/tHVQrjcan/h3Wi6PlNAHbUl1SQxF+EQsTcDCKheQtfXsq0Hhvi5PkG7y nVLQobdY33+KuGM7KLzWtdETYuPX0n4BPYBZIv5EIALkzAzH2zwC/kRgCbXFRPOU6eWk oA4gDC4elKNEi3pzS0Z7Q1qq8IdY61eTh7mvzOI7BGA5SkzaM1she1XTZqFyWYDTDSVv pRok0UlQ5wBbsoUqBbs8NMfAvqYs8obhgcNPUo1MmXE9UTkgPPoDkoqk2pHSx0hQN4mY pvsQ== X-Gm-Message-State: AOJu0Yzo+dq8zwjxSRXsVx79ai7SXiZyELkBAylaWC/gM3oC3AnU0ArQ V2tqTbzbtzfo13N9BkAJcySXsj5gCfaiHZvllGLnVSLWDsZxZ69YOydLrkVA X-Google-Smtp-Source: AGHT+IHuP9DGzUmqftVXnmBIDcVuJVXwEwoyhDZFCMfgW9BMBQT6kQxaGpUa1L1kJ5leYaFXUPMP+t+j+YjoEbUgalc= X-Received: by 2002:a05:6214:16c4:b0:67f:9476:dcfd with SMTP id d4-20020a05621416c400b0067f9476dcfdmr8131444qvz.106.1703524492087; Mon, 25 Dec 2023 09:14:52 -0800 (PST) MIME-Version: 1.0 References: <2272bc41-6ecf-4993-a8eb-f82c9f161b9b@app.fastmail.com> In-Reply-To: <2272bc41-6ecf-4993-a8eb-f82c9f161b9b@app.fastmail.com> Date: Mon, 25 Dec 2023 18:14:41 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="00000000000037a4d7060d58b41f" Subject: Re: [PHP-DEV] RFC proposal: worker mode primitives for SAPIs From: kevin@dunglas.fr (=?UTF-8?Q?K=C3=A9vin_Dunglas?=) --00000000000037a4d7060d58b41f Content-Type: text/plain; charset="UTF-8" > Forgive my ignorance, but why no connection? You mean the > pre-worker-start part needs to avoid an SQL connection? Why is that? That > would be something that needs to be super-well documented, and possibly > some guards in place to prevent it, if there's no good way around it. > (This is the sort of detail I'm thinking of, where I just don't know the > implications but want to think through them as much as possible in advance, > so that it can be "safe by design.") > Sorry, I made a typo. I mean "libraries must ensure that the connection **is** active" (if the connection timeout has been reached, the library must reconnect). Your worker script will be long-running code, as in Java, Go, etc. So if it depends on external services, it must check that the connection is still active, and reconnect if necessary. This is the default in most languages, but not in PHP (yet). Do you have an intent or expectation of a worker-style SAPI being shipped > with PHP itself, or for that to remain the domain of third parties? > As I tried to explain in my previous message, this could be nice, and possible, but I don't plan to do it myself for now :) > I mean more what implications would there be on how user-space code is > written to be worker-SAPI-friendly. (The SQL connection comment above, for > example.) I have not worked with any of the worker-ish tools so far > myself, so other than "you'll need an alternate index.php for that", I > don't have a good sense of what else I'd want to do differently to play > nice with Franken and Friends. > As far as I know, there are no other implications than memory (and other resources) leaks (https://laravel.com/docs/10.x/octane#managing-memory-leaks) and timeout handling. > The idea of combining fiber-based code with supported worker-mode runners > sounds like a ridiculously cool future for PHP, but I don't know how windy > that path is. :-) > That already works if you use FrankenPHP! Joe also experimented successfully using the parallel extension instead of Fibers: https://twitter.com/krakjoe/status/1587234661696245760 --00000000000037a4d7060d58b41f--