Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93066 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94299 invoked from network); 4 May 2016 10:59:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2016 10:59:37 -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.213.175 as permitted sender) X-PHP-List-Original-Sender: ua.san.alex@gmail.com X-Host-Fingerprint: 209.85.213.175 mail-ig0-f175.google.com Received: from [209.85.213.175] ([209.85.213.175:36341] helo=mail-ig0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/B2-08540-816D9275 for ; Wed, 04 May 2016 06:59:36 -0400 Received: by mail-ig0-f175.google.com with SMTP id u10so143471392igr.1 for ; Wed, 04 May 2016 03:59:36 -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; bh=xjIWBQeiiHNOVGZX3oPGBGl4EJl8SBvDZPA9WsGMqmQ=; b=v+o8wXNi2WwBiupuh2IZqPLTGkPk+vycNZRvawSECjI5E6lHDvqfzxPWwn1wK/lCGn DY/GiY6NABQi6/R3Z4OTJ4TllrjDlVgwk1uTIe7/EQgr8xBFcUkgrQXSYEELcLoPH8Jm 2IEikP9yQvG00b7XgmSJn1/d22myI1+9kNfrGR6ISPivngz5AiUYPGmmJuRcoaR0Yxmy BRt6hcoAmtRFnKzLDLwAGtg14Q6o7UcDFsoaeVFySvP+QGJD51Bp4qsNtNSv61FksKjh AjWCyinOYRCpk/QJvlLBkJXj8FHGdEd0PbV04voFlio/QAd5F78eni3VSlhLN2Eabxqw riPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=xjIWBQeiiHNOVGZX3oPGBGl4EJl8SBvDZPA9WsGMqmQ=; b=bBXh4qVePCYxCw8GuOEXiXII/m0hZBQ0oHVKmmsxWIuv9v4/UMJX0KHCW1YQM8kF89 x7wL/CjW2GFwJ2/choGzJ0AxabtkccAP9QUJLGsEdgjhV559cxYF8qLULsJ6A/OROZfN OFzQYy0mRy4oQV6XMoPc0qSrUro2zHL3p3D7gl/OKln7+gvNWxq4lWtAAPrK1lVBFjs9 n58Hc2XQQwnAnjGB8X6yL/G8vX7mI+bupfjUoBkxNeDHUSoj2TH9M/54OOJ+i+KwCnw4 +xm8hYgm+2dGkwEYxMdD9cXaDk0d8w2PKdO9lOm+1JHJVUv8XdOnt6SW5qvWF+GxJCwy oUSQ== X-Gm-Message-State: AOPr4FWyV/xumlVBaKMOgj4HEkmPMSC296W6d2ycjNNT5a/9sFa9t+Vj9/N981wYpjB1nxEfEwNiJhJwzYyz8w== MIME-Version: 1.0 X-Received: by 10.50.129.69 with SMTP id nu5mr9763794igb.45.1462359573279; Wed, 04 May 2016 03:59:33 -0700 (PDT) Received: by 10.50.54.201 with HTTP; Wed, 4 May 2016 03:59:33 -0700 (PDT) In-Reply-To: <18.B0.04700.FD2DC065@pb1.pair.com> References: <18.B0.04700.FD2DC065@pb1.pair.com> Date: Wed, 4 May 2016 13:59:33 +0300 Message-ID: To: Stephen Coakley Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: async/await - is future reserved words in PHP 7.x? From: ua.san.alex@gmail.com ("S.A.N") > I think we can spoonfeed the massive undertaking a bit by spreading it > across several iterations just to get things going. An idea I had was to > just begin by providing coroutines as part of the language. That would > include a `\Coroutine` class, as well as await / async keywords. This would > at least enable third party async libraries to be more compatible since they > would have the same await types and semantics. > > The next step (or at the same time as the first) is to provide some sort of > `\EventLoopInterface` along with > > \EventLoop::getLoop(): \EventLoopInterface > \EventLoop::setLoop(\EventLoopInterface) > \EventLoop::run() > \EventLoop::stop() > \EventLoop::tick() > > To start out, just provide the internal coroutine scheduler as a default > implementation. Coroutines would use the "event loop" to schedule resumes. > > Doing so would allow even more interoperability if a library chose to > implement `\EventLoopInterface` in its event loop, where it handles > coroutine scheduling (or lets it fall back to the internal one), and could > also provide I/O "extras". > > The final step would be to bring libuv into PHP, itself as a better default > implementation of `\EventLoopInterface`. > EventLoop interface, on development stage: https://github.com/async-interop/event-loop PHP wrappers for libev and libeio supported PHP 7. https://pecl.php.net/package/ev https://pecl.php.net/package/eio libuv - certainly better because it has everything you need and a huge community. Very need async/await in the PHP core (based on generators). Perhaps there are plans in core developers, for implement async/await?