Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99549 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85604 invoked from network); 19 Jun 2017 14:40:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2017 14:40:36 -0000 Authentication-Results: pb1.pair.com header.from=pencap@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pencap@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.171 as permitted sender) X-PHP-List-Original-Sender: pencap@gmail.com X-Host-Fingerprint: 209.85.220.171 mail-qk0-f171.google.com Received: from [209.85.220.171] ([209.85.220.171:33885] helo=mail-qk0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/57-13828-262E7495 for ; Mon, 19 Jun 2017 10:40:34 -0400 Received: by mail-qk0-f171.google.com with SMTP id d14so34937896qkb.1 for ; Mon, 19 Jun 2017 07:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3U91f2CueJaqWYCGpFd6ASzV0LEsq9nQzx9gMKzDEUE=; b=W6/i/qrZ1fmjTWiF6Mpp/ommsvosi/ltPbCTVaWDrzI7ZampdA6VarfHQHrRNlJHuQ ofvgi5uvXVHWWsMduLk4fBBnT1rDD79MqgbKU7KOWPqmmvrdHksvIY5OXEsw4k6N9n1r mGYI9quzGh1jBYA+bmr74jD3AhgUp/9oS6kJbGaY7xShdF8WTtuoOtEPiSxoPXQhloUa 2a2fUqQjRUNXuNDsOtChOwg2q9Gu1/PV4XgkwBC7bTld7lW+zUcPnJPtIzOFYpvaPVQJ dhPS0KlAXFEYy8LloUmGunrPshfOyNUF9ZS1A6pclbLfmBxa0xA4wNeZRNUj+WMrz3E2 3p9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3U91f2CueJaqWYCGpFd6ASzV0LEsq9nQzx9gMKzDEUE=; b=ex7TekOjch3oMMHobaNYEqUtFvVonCPRdeFytCn/EFxVG8YFS6O2UOZTSZvxsTrW+f sTNN1D+5jO3Ruc2wqxTdqTfvTzVyPT7/+PJrSBZsIke9iFZVom/e/zP2JpdXQ+iP8wI3 57Az2KNd4y3RNPzHUL6gLMBKN7+NV47eWZgGIvEYkoXIFfJqmfKLYgCSA+CmqyBqZ4dH o9V2v0Axu95RdKyuyrLOf1J9kgFqjKsSrinxSa2WCZFnu/J41/e/+XEv11jtfBFh2LOq Q24ZJzp4H1s2/WXTcvVjzmvA59rpXkCIUN3MQmBBgP1e4b36eFYlgzp91pdd+1eOZOhj E9AQ== X-Gm-Message-State: AKS2vOyHt66B0wRRXoAicx4taAT8AUpZjtQ08ZCmOqknNsjSV/aP4BBs b3B0bjkBCxv7TVNkwcq+hTUVu+1SBg== X-Received: by 10.55.41.14 with SMTP id p14mr18345497qkh.209.1497883231521; Mon, 19 Jun 2017 07:40:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.142.139 with HTTP; Mon, 19 Jun 2017 07:40:31 -0700 (PDT) In-Reply-To: References: Date: Mon, 19 Jun 2017 09:40:31 -0500 Message-ID: To: Sammy Kaye Powers Cc: PHP Internals Content-Type: multipart/alternative; boundary="001a11406370ee10050552511d4b" Subject: Re: [PHP-DEV] [RFC] [Discussion] Retry functionality From: pencap@gmail.com (Mike Willbanks) --001a11406370ee10050552511d4b Content-Type: text/plain; charset="UTF-8" > > Hello internals! > > The RFC that proposes adding retry functionality to the > `try/catch/finally` block is now officially "under discussion". > This feature seems like something that would be extremely useful. However, the proposed syntax for the number of retries for a block level seems to get me. I think what might actually be better from a functional standpoint is: try { doSomething() } catch (SomethingException $e) { retry 3; } catch (RetryMaximumExceeded $e) { $e->getOriginatingException(); } Forcing retry to only work on the keyword level and then providing a distinct exception when the retry has been exceeded. The issue obviously with the above is that you would need to be able to add the originating exception to it rather than bubbling up. What I like more about this, is that it makes it far more clear as per the rejected path and allows you to determine that you had to throw since the retries failed so many times. Often in many applications, you might retry a couple of times and then defer that action to be handled in the background at a later time. In addition, you may also still want to handle that exception to check certain criteria around the failure. For instance, it is often that libraries reuse the same exception but providing different codes and/or messages that you may want to check to see if it is retryable or add additional meta data to the response. I also think that the RFC should state that retry keyword MUST be used with a numeric number to prevent continuous loops. Eventually all loops must die and preventing this early on seems to be something that would be a good idea to handle. > > https://wiki.php.net/rfc/retry-keyword > > Voting will open on Monday, July 3rd, 2017 @ 9 am CDT. > > Voting will close on Monday, July 17th, 2017 @ 9 am CDT. > > Discuss amongst yourselves. :) > > Thanks, > Sammy Kaye Powers > sammyk.me > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11406370ee10050552511d4b--