Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113441 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85185 invoked from network); 10 Mar 2021 18:00:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Mar 2021 18:00:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 71340180087 for ; Wed, 10 Mar 2021 09:52:39 -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.0 required=5.0 tests=BAYES_05,BODY_8BITS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mercury.negativeion.net (mercury.negativeion.net [199.38.81.6]) by php-smtp4.php.net (Postfix) with ESMTP for ; Wed, 10 Mar 2021 09:52:38 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id D451E20CBECE4C for ; Wed, 10 Mar 2021 12:52:38 -0500 (EST) Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NgCBzYQqDi3C for ; Wed, 10 Mar 2021 12:52:38 -0500 (EST) Received: from [10.0.1.102] (unknown [173.225.146.47]) by mercury.negativeion.net (Postfix) with ESMTPSA id 1768A20CBECE3F for ; Wed, 10 Mar 2021 12:52:38 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) X-Priority: 3 In-Reply-To: Date: Wed, 10 Mar 2021 11:52:37 -0600 Content-Transfer-Encoding: quoted-printable Message-ID: <93080AB7-0567-4996-BD73-C3F721225FD0@trowski.com> References: To: php internals X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] [VOTE] Fibers From: aaron@trowski.com (Aaron Piotrowski) > On Mar 10, 2021, at 2:15 AM, =E9=9F=A9=E5=A4=A9=E5=B3=B0 = wrote: >=20 > Hi ereryone, My name is Tianfeng.Han, I am founder of swoole project. = We have done a lot of exploration in cli server side programming of php >=20 > I think, ext-fiber is more suitable as a pecl project. >=20 > Coroutine and asynchronous IO is a new concurrency model, This is = very different from blocking io. >=20 > I am afraid that fiber can only be used in the amphp framework and is = of no value to other php projects. >=20 > If the PHP language wants to support CSP programming like golang, = asynchronous io and coroutine system can be designed in the next major = version (PHP9), this requires a lot of work. >=20 >=20 > Tianfeng.Han=20 >=20 Hi Tianfeng.Han, Fibers will immediately benefit projects that use async I/O. This is not = limited to amphp, but also includes ReactPHP, Guzzle, Symfony, and = Psalm, to name that I am aware of that could use it in conjunction with = I/O and multi-processing. One of the ReactPHP maintainers and I collaborated on a proof-of-concept = for ReactPHP, which is mentioned in the RFC: = https://github.com/trowski/react-fiber This fiber API was meant to be a lightweight implementation to enable = user space green-threads/coroutines. I would love to see more async = tools in PHP, but that will require much more work. This is meant to be = a first step toward that eventual goal, without conflicting with or = restricting future additions. Cheers, Aaron Piotrowski