Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122071 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68594 invoked from network); 30 Dec 2023 10:53:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Dec 2023 10:53:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A4A39180053 for ; Sat, 30 Dec 2023 02:53: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, MISSING_HEADERS,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-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 ; Sat, 30 Dec 2023 02:53:49 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40d560818b8so49412815e9.1 for ; Sat, 30 Dec 2023 02:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703933600; x=1704538400; darn=lists.php.net; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ESi3YwwqWIXAHrtZGeuYu/h583gpdbiDgpycq3CGiqs=; b=kMQ6d0+1G5ftmJUOKM/vKo7mgYJOD61ne2xJfB5sTHF/Txrzm09MtrhQMiTEkMLkZ5 HQyv4qU5A6LVY+3Y5XOQUsujxc3DGF/2/kDW3zKYt80ZofTV1wYqUy7mKa3DNY59E5mD 2R4Amf7YAGhweh/U8cw2q6umkJIDpWJxtl+9KcmDmNSyQYvfrJxHIUAoL3IIvjocuuiU IGHYEfuy7iqaf/q5hnYuyORjzpvYdiA68rHnyyPRyBXF+6gw0UY5FG8IAW0txmWQB7Hp IDqZ92pchw85tZG4j1MVCEhg3spv6pRBsdYgrrI69k3Lk3TXwbhw7vg8+4j9OHPtfp16 jV2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703933600; x=1704538400; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ESi3YwwqWIXAHrtZGeuYu/h583gpdbiDgpycq3CGiqs=; b=gbD7Z3XWZ1AJ/ouxxGhx/QKg58HSvlFCF2JjyUBceQIHeMCEisdl81LfcImoieYX5N 8+8a0iMYmOLT/1kQjic+rNj1XgA9rJvt2rhHbeMimZIESmFQsHpdWJVNYn5352lrNlOM gNw6063G98wwKFln1BZL0vfnTxDz1KZWfd4Og0hMi0wZatV++QcbS8wBwCOM2kWMvidR IOFLVGaJAqlzXqLt3C3+X4mllLIK52O0XhzO9qDC5BE4MLwer76F0R6yuccs2N9OcNQr olfHE7XFTtVWPpkSTeEJTLXB3iSwgrIYM+Lrf2/M7MkYKM70YbSsfyFUWTYVd9wYG70y ABCQ== X-Gm-Message-State: AOJu0Yw50m050rZabv6ETB5ziiJl5SXhIzCb/kxWHm7COgg8RSmucCDw s5saJuYefInR5Rxt5WmP3vbPoB7gLYY= X-Google-Smtp-Source: AGHT+IFeOK58vRBkFqdaGO+jJOio7JUq6rIp2ygb0OfCBjBU+b0Ji9kciAfqTn2yfpeWDm7KOetyXg== X-Received: by 2002:a05:600c:4aa9:b0:40c:1e84:c44d with SMTP id b41-20020a05600c4aa900b0040c1e84c44dmr7201035wmp.14.1703933599622; Sat, 30 Dec 2023 02:53:19 -0800 (PST) Received: from [127.0.0.1] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.gmail.com with ESMTPSA id i2-20020a05600c354200b0040d5ac00dc6sm14995400wmq.8.2023.12.30.02.53.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Dec 2023 02:53:19 -0800 (PST) Date: Sat, 30 Dec 2023 10:53:16 +0000 CC: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: <5060b986-2e5a-46e4-9c83-763e5b155e83@gmail.com> <6f7815b9-80cc-4e08-819a-49dca090116f@gmail.com> Message-ID: <7F63D301-1A46-49AA-9140-F64543E902C5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC proposal: worker mode primitives for SAPIs From: rowan.collins@gmail.com (Rowan Tommins) On 30 December 2023 09:59:07 GMT, Robert Landers wrote: >For this to happen in PHP Core, there would need to be request objects >instead of a global state=2E Again, the representation as objects isn't a key requirement=2E Python's W= SGI spec simply has a dictionary (read: associative array) of the environme= nt based on CGI=2E The application might well turn that into a more powerfu= l object, but standardisation of such wasn't considered a pre-requisite, an= d would actually have hampered ASGI, where not all events represent an HTTP= request=2E The key requirement is that you have some way of passing the current reque= st and response around as scoped variables, not global state=2E That's esse= ntial for any kind of concurrent run-time (async, thread-aware, etc)=2E An event / subscriber model fits well with that: the local scope for each = request is set up by an invocation of the callback with defined parameters = and return value=2E Funnily enough, the example of a worker script for FrankenPHP does both th= ings: it sends each request to the same application "handle" callback, pass= ing in the super-global arrays as parameters to be used as non-global state= =2E https://frankenphp=2Edev/docs/worker/#custom-apps So really all I'm arg= uing is that a few more lines of that PHP example be moved into the C imple= mentation, so that the user only needs to provide that inner callable, not = the outer while loop=2E Regards, --=20 Rowan Tommins [IMSoP]