Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122117 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63980 invoked from network); 5 Jan 2024 09:02:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2024 09:02:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1704445370; bh=KDGiVw5v+1SNI/1OiyBIV0cMIMP5/funSeXYEz2+v9I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LJ9aq5QbLQMnIGH3yTu1qFyzWCdq1dpaBciRRPKlw1xWyIq790uEzdmCjFPmxn+Fz GSFXeBvp523e/AJkVwLSZfm/1NO8eDSSiExsam6LbQUawbmZzgNM2VgXgnSckFlyOK popVuaKmGLQsMK3NLJs8M+kpHNXoUQuP5ynnnotjO4rDOpKcy2zyll3HGkCgjbtiRf Esrceuo1WwrFTREPVX0MMXmZ36kIk6mbrLwlB34856sWbqrVnqYyzryAXEQVDd9r/F uakWMyJDufDEmNXfCF/wfrwFPyHY23aNF8ux+QiMTddpwJWT3nhMOCgInONYZEyeuS EZchCWyEi3btA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 68AAF180056 for ; Fri, 5 Jan 2024 01:02:49 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (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 ; Fri, 5 Jan 2024 01:02:49 -0800 (PST) Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-595f8f7efbbso766342eaf.0 for ; Fri, 05 Jan 2024 01:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704445336; x=1705050136; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KDGiVw5v+1SNI/1OiyBIV0cMIMP5/funSeXYEz2+v9I=; b=cFZjxFmaSH7wBFWg7fXUYdnncHOv73iztn5bpbco3r+bnq/qycrmMCymOx5mcXCj6t XzvuCJccXYFp9pful7qlxtkV1p+DkNPaPCwS85VOSkhHm7Li222RwC6quI/YUeLT4SGN 794bidft2ascrhbHo7Ua2qtDJW1pLIVnYkNgvqywt7kBCXJsQOZPZyo39wJCXeAnNA46 zKcaO1leIuwosgUG3USR1KPVVacBKP46yKYFlXwitbVZnUyfi+jxeDeH9LgNtR4cWyOV sN59IN0CGCOIwFzwo8PojtkGFEv8JbI71aAP7oC4y/GjC7v1tl0ZVAm6qiiPMBWdSOBq TYmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704445336; x=1705050136; h=content-transfer-encoding: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=KDGiVw5v+1SNI/1OiyBIV0cMIMP5/funSeXYEz2+v9I=; b=vMNzovVV947z7Mg8vrPqyECooSn0I+IzOyFz33V4XIJl6Wfj8/Jfq2TzTslIX2LZ6R j/xNY+/2mi45zYG9bG2JO0pcJE+JCYhrMI4OJ+p2VMPp91w9Q3k/MsAis+EYLxab3mAy ZBwm2MC0gQgIrrxzkne5mPaj6pGmY9hvls/now7Scetf2eG+AHq6zFlsebm9WtTgDBZ+ IYFPJscvxgCvZKV+yOjvYQTr4YYfjYHA/g+GsmyhN8Crmpbj++WTki7JVNl6JTI0vC8K ZfY6+L52FZHDYTeyjMeyLPQ0J2VDO+pLVhSpSxZMqfSryS62+Cw9jwmSge3IHJGiXmcK P+Ng== X-Gm-Message-State: AOJu0YxqMDwEaW9xqBN/f1GWJVW3j1+xKWVH5T8clHzC11jlXuwQMYgJ dN6ax4BOvsvKzdqgug2I2XpAQB7oCrW3wIipL6Y= X-Google-Smtp-Source: AGHT+IELaGvoRllrxqJMFd2ZlC99/QtGUrKY33gjJPp6GD2KmclMB0Q35mHArNPiQQFyCnRYm8U2cMNbrvdbfyyAcLo= X-Received: by 2002:a4a:d29a:0:b0:590:d6d6:6122 with SMTP id h26-20020a4ad29a000000b00590d6d66122mr1475167oos.16.1704445336412; Fri, 05 Jan 2024 01:02:16 -0800 (PST) MIME-Version: 1.0 References: <3828a559-5dae-44d1-96ce-dff1a8b07c18@gmail.com> In-Reply-To: Date: Fri, 5 Jan 2024 10:02:05 +0100 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC proposal: worker mode primitives for SAPIs From: landers.robert@gmail.com (Robert Landers) On Fri, Jan 5, 2024 at 8:47=E2=80=AFAM Rowan Tommins wrote: > > On 5 January 2024 06:55:34 GMT, Robert Landers = wrote: > > >I already said this, but to reiterate: I, personally, hear what you > >are saying and largely agree with you; however, before we can really > >have any kind of discussion on concurrent servers, we HAVE to address > >the underlying issues that are missing from PHP. In PHP-src > > So, let's address them... > > > > there are no such things as request objects > > This is a non-issue. As has been discussed already, it's perfectly fine t= o have an event-based system where the event details are an associative arr= ay, rather than a rich object. > > > > > There are no such things as event loops. There are fibers, > > but absolutely no std-library i/o functions are using them > > This is what the bulk of Daniil's email is suggesting a way to improve. > > > >We have a long way to go before those will be real things that we can > >have a proper conversation about in the context of php-src. > > If we keep waiting to have the conversation, it will never happen. > > And if we start building brand new APIs like infrastructure for worker-mo= de SAPIs, in ways that are fundamentally incompatible with async, we're jus= t making more work for ourselves when we do get there. I don't think they are fundamentally incompatible. If we look at FrankenPHP's implementation, you pass a callback that gets called when there is a request. This is the same as giving Swoole a callback to call when a request is received, though the underlying implementation might be very different. An event-loop doesn't matter here and what gets passed to the callback is what we are discussing here. The exact implementation (in php-src) matters, but only so far as what php-src is capable of. Globals is how this works (atm) and changing the signature of the callback is generally backwards compatible. For example, if we start with only globals (no parameters), adding parameters later once there are request objects/arrays/whatever, is fine. Calling a callback with parameters when the function actually doesn't accept any arguments, isn't even a notice (https://3v4l.org/URj9b). Changing the underlying implementation in php-src when there are native fibers/event loops probably won't even change anything (since that was exactly how they were designed). But holding up the entire conversation because these things don't even exist, seems like a pointless endeavor since they may not even pass the RFC point (IIRC, getting an event-loop in PHP was a large part of the reason fibers are the way they are because people were against an event-loop at that time). > Regards, > > -- > Rowan Tommins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > Robert Landers Software Engineer Utrecht NL