Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122118 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67003 invoked from network); 5 Jan 2024 09:55:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2024 09:55:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1704448541; bh=BqZTdofJ+9SLyBu6AvvBhDj4vTk01v5YkNedayeDaXI=; h=Date:From:To:In-Reply-To:References:Subject:From; b=ARx1avzyDGfLI3BDkR4v1jpzRXwk+ft9vCxjaBGwiuASQJWoA5ELCYIYWRIsYQ1Fv b0+0TzkqKzUv8IaCVVUnOOzreY56w7TKGBdkSqzuZ8sHs8qNf30AZustd9O5ZL4Ci6 El74IL2i9BnImZ13z5lUmOxPLV3Dgo/25d3U1/7l+NdLku+PFL9rNNmmfm6Psn2dml n/u54JVMcbYUBQrQlZF8qObDYGUcKVJVPm88IbU9jmRwRL0iblArnFvl3R+o6U8Gwl 2usclObUjanO3rLPX87sqC2QdByVEedgrAMPyLOMp59X69vcjJ6c0NWlaFC7KPkYWM WmB20y69h6KKw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 88CE418004F for ; Fri, 5 Jan 2024 01:55:40 -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=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, 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-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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:55:40 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2cca5e7b390so16836951fa.3 for ; Fri, 05 Jan 2024 01:55:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704448506; x=1705053306; darn=lists.php.net; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=ceGXmBpDCNaSUucXUdkVMht6x1pdpIZXFb89tg5bIMA=; b=USoWbUU6zdmqyXCoy0hr3TYxaNr+osE5maytF1GJoJRDY6+o/W7cAGC31MNeDmD2U/ c6d3voJePiRQbo9+JITblSMemjAFO5HAxClEeuWni8/ZVqFg8pRopBdGBs6Tmt0lE7eY KvF7UDTqfxMp3fEv9Zw+SjASV3dTXJFSLRsZ8k3RTHbNDYz8BuTHxoejnsWB3bo7t9Ul /po2TuMRPEwTnNgQA6Pvh/nOmommS4IQzJxtecN+BnNOtgoMvg/KZVUZZ3UD5w+8TPE1 J8TXuRHCd0c1oXwfYwlan3Ka2NqBEnn0uXEsLhXlrC30KEGhooJDZ4+BOEnVwXhEBiur 7w9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704448506; x=1705053306; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ceGXmBpDCNaSUucXUdkVMht6x1pdpIZXFb89tg5bIMA=; b=A0025H4+8DpqicR7WsIM22e5YsvB2jyXeLE6E6Sl0OMyMoRK34qF3Avv5PnSKszSsT v85y4hKa22Ec/8qNPeWYfuEkRTwdapaAyxpu5rAYJ+KX3dllPicuxsisrHSqvb3ww5iY 2LS4+O0imcBnWKHRCLQuE2UF2x8rDhu7GMtuc0Vvqg6Jk3Solacuw9tSNHqBU70tuFaw RCJgEzKxrtxiWzzcMNe22+PRnByDHUBrKcxwVL2ocpOgCP7w9LKBzDZuaC7AMSz+x6T7 9ZbyZCbUpTdOKf7wcjA/aglJKhwGW1PxtRO38/74yhiBHPinLfxRf8RQe4zdprJwJ9ce xS3w== X-Gm-Message-State: AOJu0YxYHWYrSevJfY5KixEbWWy3iRQKDe2bCs7gQJPGGqsr0wkQP7E5 zvpkH0r4ED11xXLZsyjLhnHbvcBb72cxZA== X-Google-Smtp-Source: AGHT+IGOz5mfolhwpN59QvSEM0K5IVpXRpfaonH0SI0l/MhViXVyMViWCMKDldkfMu/0vQSUfpRiaQ== X-Received: by 2002:a2e:880f:0:b0:2cd:36ff:4d7c with SMTP id x15-20020a2e880f000000b002cd36ff4d7cmr58207ljh.9.1704448506035; Fri, 05 Jan 2024 01:55:06 -0800 (PST) Received: from [127.0.0.1] ([128.116.205.77]) by smtp.gmail.com with ESMTPSA id l21-20020a056000023500b00336755f15b0sm1064423wrz.68.2024.01.05.01.55.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jan 2024 01:55:05 -0800 (PST) Date: Fri, 5 Jan 2024 10:55:02 +0100 (GMT+01:00) To: internals@lists.php.net Message-ID: <7c9cc538-c925-4b97-83d7-bc29dc540bd5@gmail.com> In-Reply-To: References: <3828a559-5dae-44d1-96ce-dff1a8b07c18@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4_27601561.1704448503031" X-Correlation-ID: <7c9cc538-c925-4b97-83d7-bc29dc540bd5@gmail.com> Subject: Re: [PHP-DEV] RFC proposal: worker mode primitives for SAPIs From: daniil.gentili@gmail.com (Daniil Gentili) ------=_Part_4_27601561.1704448503031 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, > But holding up the entire conversation because these things don't even > exist, BTW, I'm not asking to wait for the implementation of a native event loop before implementing a worker mode, I'm asking to design the worker mode API in a way that is compatible with an eventual native event loop (that I hope will eventually get merged into php, as the current status quo of blocking STL I/O is definitely not ideal for a programming language in 2024). Using superglobals for request information is already using a wrong approach in sight of native async, and while technically this is not completely incompatible with fibers, as superglobals can simply be copied immediately as soon a fiber is started, the same cannot be said for php://output and php://input streams, which cannot be copied in any way. I ask to completely avoid altering superglobals and other global state such as the php://input/output streams, and instead directly pass/return an array/object (it really does not matter to me if it's a PSR-7 RequestInterface or an array containing _GET, _POST, input, output keys, or anything else as long as superglobals and global state is not touched in any way). Backwards compatibility for code using superglobals is really a non-issue here, as worker mode in itself is already potentially NOT automatically backwards-compatible with legacy code, since applications running in worler mode have to deal with the fact that the global state is not reset at the end of each request. This in itself is not an issue as mentioned before, thanks to work inside of major PHP frameworks to better support worker mode, I.e. laravel octane, but since the beneficiaries of worker mode will mostly be modern frameworks and most legacy code will already require changes to better support it, using a new API with a standalone request object/array instead of superglobals is not a real issue. Regards, Daniil Gentili. ------=_Part_4_27601561.1704448503031--