Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100485 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29224 invoked from network); 9 Sep 2017 10:12:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2017 10:12:57 -0000 Authentication-Results: pb1.pair.com header.from=i@lvht.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=i@lvht.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lvht.net from 54.254.200.128 cause and error) X-PHP-List-Original-Sender: i@lvht.net X-Host-Fingerprint: 54.254.200.128 smtpbgsg2.qq.com Received: from [54.254.200.128] ([54.254.200.128:53771] helo=smtpbgsg2.qq.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/36-10715-2AEB3B95 for ; Sat, 09 Sep 2017 06:12:52 -0400 X-QQ-mid: bizesmtp16t1504951964t0sshi5s Received: from [192.168.1.3] (unknown [218.81.64.210]) by esmtp4.qq.com (ESMTP) with id ; Sat, 09 Sep 2017 18:12:43 +0800 (CST) X-QQ-SSF: 0130000000200020F440B00A0000000 X-QQ-FEAT: mXTiyeZ13VbrfiDgo8qV0jaS8kvJ0vHS0OW0kY8JXl5ijNMITXDgdpUK1jzAU AbN0kbL+F2UzXCFh58TqYI7zulq8RNmNU55OkDZ0CLq28ouifSCLA7c59ktFy9JwYvLj1X8 +OlD7i/oq19DD8kPQ/7uxtLQb3AembFW988nn0yS2UOEobRZTFYMw94dUeLbMHUmgqvo80t S4niIsMpJthtmHUcDFxC148P6hviXKNgO2xgkFn9mv6C6SbYal2XjXZpzwVOUT3RPAutjWZ j6MQ== X-QQ-GoodBg: 0 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) In-Reply-To: <4D64625B-AA30-4493-84F0-F523ED459D60@lvht.net> Date: Sat, 9 Sep 2017 18:12:51 +0800 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <9902BF81-AF15-456D-BA4A-E146591FA904@lvht.net> References: <7E991FBB-C115-4AB9-B904-EBE7C0F24089@lvht.net> <8DB5D7F2-CB7A-4324-AB9F-D9934DD9C108@lvht.net> <4D64625B-AA30-4493-84F0-F523ED459D60@lvht.net> To: Rowan Collins X-Mailer: Apple Mail (2.3273) X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:lvht.net:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Subject: Re: [PHP-DEV] add Fiber (sackful coroutine) support From: i@lvht.net (Haitao Lv) > On 9 Sep 2017, at 14:27, Haitao Lv wrote: >=20 >> I note that the examples there all implement it not as a keyword, but = as a library function, which maybe makes more sense: whereas "yield" = turns a function declaration into a generator declaration, = "Fiber\yield", as we might call it, is just a function call which can = happen anywhere and manipulates some global state. >=20 > As the Zend Engine does not offer API to pause execution, I cannot = implement the await without > introducing a new keyword (just like yield). >=20 >> The choice of "await" also feels odd: you're not awaiting the thing = on the right-hand side of the keyword, you're sending it somewhere and = awaiting something else. >=20 > await is chosen because we cannot reuse the `yield` keyword. Maybe we = can choose a more proper keyword. Sorry for misunderstanding. The keyword await has been dropped and = Fiber::yield implemented. Please see https://github.com/php/php-src/pull/2733=