Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107942 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16186 invoked from network); 23 Dec 2019 13:34:31 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 23 Dec 2019 13:34:31 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id BC9162C04E3 for ; Mon, 23 Dec 2019 03:35:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Mon, 23 Dec 2019 03:35:54 -0800 (PST) Received: by mail-ot1-x334.google.com with SMTP id p8so21748327oth.10 for ; Mon, 23 Dec 2019 03:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MNYsYjEProK9SxNDmVMRm9JYLLpM7M+Yo4aOICjGm2M=; b=Y1gvkT75d8Y9iT01+YUHcJwsjIXNP7SsxqbTgb/lb+f/WS9J9ruTp8D4GS3nrwm1Of yV73kladFnXGIS2Pvz6rWf4niD8nmF9YACD4GjqXApujoxOGgF+SNT4dV+wmNgP5JJpf 33/IvJvIcZzcZ/xhDhn0FwbQIHPwWGs+vCs4BKyxu/Ph/UvrGNJ+jVKAu2V1qRgW8XCC U9DXqzhzQBjQfRcCk+mhONU1qPDfaXai0EXOAfoIb583rTCkhwegkTLZXR+8hWJxIR2+ 8Pq/DKwlmNd4FqXMit7Ld3gksOZfpdvpOgRzraGDj+xNYRBEd5GWwY9EEH7oKZt1h+m2 9VIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MNYsYjEProK9SxNDmVMRm9JYLLpM7M+Yo4aOICjGm2M=; b=fZhtKfw8JVB99UTpKM0UkWzCl342717Ua5VbLWtBSFXWzUwrABeASZp2mdP0YaXnQu fMssDp57X301idqSsPoWJKUHuBcDmAvFzzkjmhd9iM1BYzom1WxmWoqmxfGG66E7tmSo yB+sGqANdyUseDBj+K7nvDIMx8jXVqsWOHpFDALOtNIWWHmQjWVP4YapSuG5U1IXssU4 dUhHZxGrDRZiB0pULPcZQz7z3taRJ/Zn51NJd6hxu8PHMq83Fog20sz3RMIfnxYQWGXR LYIrqFfOs4BXsmHe0tu6yhxKYVRVGppMgpBohNXxqPrVnLtsthH38PoEv/jEVthMK0jR wZsA== X-Gm-Message-State: APjAAAWn/opL1PRT2yc2EQudL8vlGlWVyEo31umGYcRqNpuFtDvAWmre RUOV/Xi7DR1q4EK3DPlEVrDYFEX8PphWpiHu9y4= X-Google-Smtp-Source: APXvYqzRsk0V2h3jjpMvPB2ioZNEq+ILklGh+QwvKAg1CReC7abEIR8zmhfam+7BXTkm0hbutOKE5JxNmsDK9hnP09E= X-Received: by 2002:a9d:6c99:: with SMTP id c25mr13738685otr.178.1577100953589; Mon, 23 Dec 2019 03:35:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 23 Dec 2019 11:35:42 +0000 Message-ID: To: Aran Reeks Cc: PHP internals Content-Type: text/plain; charset="UTF-8" X-Envelope-From: Subject: Re: [PHP-DEV] Support for Async / Await From: robehickman@gmail.com (Robert Hickman) Does this actually fit in with php's execution model of each request being a separate thread / process? As far as I understand this kind of async programming is only useful within an event-loop architecture as used by nodejs for example. There are things that do this for php like ReactPHP, but it is not how the language usually gets used, at least now. Making this really useful would probably entail changing the execution model to one where requests are handled by long running processes. On Sun, 22 Dec 2019 at 20:59, Aran Reeks wrote: > > Hi Internals, > > Since the start of PHP 7, we've seen some amazing performance improvement > version by version as a result of core updates. > > Now some of the biggest wins have been implemented (with JIT due for PHP > 8), I'd personally love to see support for Async / Await introduced in > PHP's as a core language feature too. > > Being able to perform tasks in parallel such as reading or writing to DB, > cache, queues... Would be a massive advantage and the performance gains > from it could be really exciting! > > Looking at how Hack has implemented support, this seems like it could be a > great start for a RFC, what does everyone else think? > > Here's a link to Hack's implementation for reference: > https://docs.hhvm.com/hack/asynchronous-operations/some-basics > > Thoughts welcome from everyone. > > Cheers, > Aran