Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41470 invoked from network); 29 Sep 2015 18:04:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2015 18:04:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=ua.san.alex@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ua.san.alex@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: ua.san.alex@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-io0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:35555] helo=mail-io0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/57-05836-A92DA065 for ; Tue, 29 Sep 2015 14:04:11 -0400 Received: by ioiz6 with SMTP id z6so19919475ioi.2 for ; Tue, 29 Sep 2015 11:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=L9b1dAyUdJfDCUrrpty7W5bs9fAQ4WcfgsntDnFyz8U=; b=ndwnTFwav8/ZUuLaebXVz6fz9hfCbNBi1W9AwQjBqREYu9ciMnwA80BHIoRWR8khQn vWC7TyTqEK+aeMoUCzCrK8CufPTb+J9INCR1OI+yM3NscUwGDYG61d1V7HRVJMddnAQ0 oELylXC324NMcFYsq7WH18IrbOxXdbHQPpoODCzzWPLBsJTuu4Sw4Bb21/z6TvIdfkMB Uo5GRddom3wFj+mFkPchcqVUHfMHIc0Y7+SNol+7n5ZIaNBk8EFhN0I4w6YYLLu0PjAV GDcnPrKiUP1S0bCO7NE7xD+fcrnyn++xQaJ5+9iZX0+s1irZ5Jqwu+f6Z2XdXvUrF9wQ JWNg== MIME-Version: 1.0 X-Received: by 10.107.12.146 with SMTP id 18mr40920iom.78.1443549848066; Tue, 29 Sep 2015 11:04:08 -0700 (PDT) Received: by 10.50.93.42 with HTTP; Tue, 29 Sep 2015 11:04:07 -0700 (PDT) In-Reply-To: <09A2B2D4-EAE9-46E8-AF5C-4E83C4F3D8A2@icicle.io> References: <56095A0C.4070306@cubiclesoft.com> <1443529244.15520.67.camel@kuechenschabe> <560AACB6.9080909@cubiclesoft.com> <09A2B2D4-EAE9-46E8-AF5C-4E83C4F3D8A2@icicle.io> Date: Tue, 29 Sep 2015 21:04:07 +0300 Message-ID: To: Aaron Piotrowski Cc: Thomas Hruska , Joe Watkins , =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Kalle Sommer Nielsen , Pierre Joye , Levi Morrison , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] async/await - is future reserved words in PHP 7.x? From: ua.san.alex@gmail.com ("S.A.N") > Implementing elegant, readable, and stable asynchronous code in userland = PHP code is very possible. In fact, I=E2=80=99ve done exactly this with Ici= cle (https://github.com/icicleio/icicle). Icicle uses generators and promis= es to implement coroutines. When a coroutine yields a promise, the coroutin= e is interrupted until the promise resolves, sending or throwing the resolu= tion value into the generator. While a coroutine is interrupted, other code= in the program is given the chance to be executed. This behavior is simila= r to async/await, instead using a generator as the async function and yield= as await. There are several packages available for Icicle that implement n= on-blocking I/O and concurrency (multithreading). There are no extensions r= equired for Icicle and no black magic =E2=80=93 just making good use of the= tools already available. > My experience says that callback, promise, yield, not transparent as the async/await in =D0=A1#. In other languages: Python - coroutines with async and await https://www.python.org/dev/peps/pep-0492/ ECMAScript https://github.com/lukehoban/ecmascript-asyncawait When Node.js appear async/await, many developers and projects will migrate to a Node.js, if PHP is not implement async APIs. Hopefully, Dmitry Stogov and others, will make another surprise: PHP-Next-Async? :)