Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52858 invoked from network); 4 May 2016 19:56:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2016 19:56:34 -0000 Authentication-Results: pb1.pair.com header.from=ua.san.alex@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ua.san.alex@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.193 as permitted sender) X-PHP-List-Original-Sender: ua.san.alex@gmail.com X-Host-Fingerprint: 209.85.223.193 mail-io0-f193.google.com Received: from [209.85.223.193] ([209.85.223.193:35944] helo=mail-io0-f193.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/84-16256-1F35A275 for ; Wed, 04 May 2016 15:56:34 -0400 Received: by mail-io0-f193.google.com with SMTP id k129so7213914iof.3 for ; Wed, 04 May 2016 12:56:33 -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=eNAi0zIrWbuGqLOKjiyiTEQ2CrD7ZP+PkeQgsd+VYCE=; b=K2NeS1scRQ6WHys1T24h9o02DHORXrzzgMC8xJM2Cfs4ZUR00e213f20qZ3Tg5xNKh liKAnEQB2qfFJQzehEwufvZYS8O4BRBL4BsImBOj+FIi9gUmDZuko2uWpG/E+O2FOdNQ /4xRArmWr1S6ISSzvdAq0ecvPMUaSxa2O7QwYvGEDHQaSPr9CeFEfke9TYf8D0eJSsLL XNH9v/2XALiwtmBH0WcsU99U8d3jPYYWongV5Sset20DiUmJZJyYZN7RxRwHVoVyz5xX u5zuWq+5do71SeT9daAOi1FbaxAaOQ2Ia/q9r5w3XNMXkFXVTEv0tmRY7WQmrvF1PAhl YiGA== 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=eNAi0zIrWbuGqLOKjiyiTEQ2CrD7ZP+PkeQgsd+VYCE=; b=Gj35Q1udj3GG2btyP3u9DE8dmzrCN+UPr7niiPu4oKTL0OCbY9v11trlRBmHyztgB5 0eNvLGBQyGHmB0Ng1ylXUHX2aFvEXzo0arBBaFxJvPGFC5fqvrTxn1IzgR9aNSHyRTfV vWLGmgi8yQ0sX5LRXM5KPiRYsnenHxNGPEEBpAsdr9fUJUyOVcVWttdjzqSOm7bmNGno ycOcNFOuhfhILkJd+E+b9Mrfgxld2al506au1btEeMbCvkwgz36eprJt24hSvc2oLNxN sqxnx6dqKLFrGxuOh8d2LJZ2mzvxb0J5LfMw/veEk7OfBC154/5xBMUczAIPH2tSNBsF oD+w== X-Gm-Message-State: AOPr4FUFmcQucG1LUDZztBouqfsHPowtz1Bcv5955FpksLUXcYGljCOMSNPfXo7HDjrrqeRq6w43xXYX6uDfKw== MIME-Version: 1.0 X-Received: by 10.107.176.139 with SMTP id z133mr12009794ioe.78.1462391790661; Wed, 04 May 2016 12:56:30 -0700 (PDT) Received: by 10.50.54.201 with HTTP; Wed, 4 May 2016 12:56:30 -0700 (PDT) In-Reply-To: References: <18.B0.04700.FD2DC065@pb1.pair.com> <38.90.16256.DC90A275@pb1.pair.com> Date: Wed, 4 May 2016 22:56:30 +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 don't think we should wait, I was just thinking that it might not be ready > until that time. > > Also, if we plan on rewriting streams and I/O to all be async and use libuv > underneath, that would probably be a BC break unless the existing functions > just become blocking interfaces for a separate async API. If it was a large > BC break, it probably would need to wait for PHP 8. > > Now that I think about it, that would be our chance to replace stream > resources with classes... > > $file = \php\stream::open("file.txt"); > $bytes = await $file->read(1024); > $file->close(); > > Then rewrite fread() and friends to be aliases that block instead of await > results. This is a great opportunity to normalize API standard libraries PHP :) > $bytes = await $file->read(1024); It is rarely necessary, more often needs $result = await $db->query($sql); and $result = await $noSql->get($key);