Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113588 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50413 invoked from network); 17 Mar 2021 09:12:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Mar 2021 09:12:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A71F41804C0 for ; Wed, 17 Mar 2021 02:06:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 17 Mar 2021 02:06:20 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id s13so1103095lfb.2 for ; Wed, 17 Mar 2021 02:06:19 -0700 (PDT) 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=jwg9VFg0Bdx5Y9Iqn2rSndY2/LL42Zumpy4T7iCO+mE=; b=CR4ajIQkwl5MM53vhhLhys81IaVRWPMwJAQouku/IdoeN/fA98Mzzx0DuTwhG3Vxj/ s8BlgC7WkLqS+jIuY3W696QOD+FEarPuZuvbBgbx46HVXY+388/kyoLkVyIu/Yff5Q9+ k1tJiGaQ0quHMfDrjlsnYwj7BTmsWbTghk4srGXLBqrlJUU/WsF7zoby+3Q6bEQ7u+5+ TUWWc8MI0o4ZBF7KU91KjPHcbTpIvTGBXfe4s0Lv3yJuFj5hwdcAmpPMfztpUAi0+OGt LyvdnUU7tbrkAGNnrJXZzUPSVSNAx8/603596GNduoqO8J15dcNhp0E/uzdQTFAlDLEw 2VkA== 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=jwg9VFg0Bdx5Y9Iqn2rSndY2/LL42Zumpy4T7iCO+mE=; b=Qa4egdmkA0M7o+RwQk9WwI0Myt5APwxOvNOp7he6ZXolZSoOFk2WD6mlBx5TfuahhB cOxqldhW5oGgAQZ/77pJXc/36Ia5tchzvghvToJ7SbDPzzNcHuMZJp0Mn3rmpEaF5RE8 LbuNwtGHpFnQaoJjzXXEIHI+XLNPFSMMPnqStycBdWKYeCHDf3YAXdsgn5VHdnhxq5Oo 3mbNnDZydbtuz2+Gagpw8R0wFHT3NELk/dhxrdBy11nAkIoVftRG0S8KV3VtitMUKYck 7tdmUruiMB+44RfPq1rXGu9e9AUbpf3TfZ0rk/9tCmG6QL5EFZx9andU3jRDCqnYjzfX S2/A== X-Gm-Message-State: AOAM532xhtudsWxADXHmIsXJQn0fAeqdRldVulWmm55QTDR25dE5Q4JB 2U4R8TYUgFBMirI3o7wXKIvZjTAOIyS3SS0VoOs= X-Google-Smtp-Source: ABdhPJzdZ338ldUrucpEN59YYbaM8PT1e6u3P8fBSzz1OSyLBFqwZURSVPTj92My5szsCJviLvvB0AgNfbfYhRPLLc8= X-Received: by 2002:a05:6512:314d:: with SMTP id s13mr1744244lfi.95.1615971978413; Wed, 17 Mar 2021 02:06:18 -0700 (PDT) MIME-Version: 1.0 References: <70951423-5e77-c150-6dce-dd3c62f8dc8b@php.net> <0b994a60-7970-605b-1657-d6ee732690e5@gmx.de> <5C73A1DE-E563-4F69-B8C7-6506F81D7345@trowski.com> In-Reply-To: Date: Wed, 17 Mar 2021 02:06:05 -0700 Message-ID: To: Josh Di Fabio Cc: php internals Content-Type: multipart/alternative; boundary="000000000000bd8a0705bdb7cb1b" Subject: Re: [PHP-DEV] [VOTE] Fibers From: sarkedev@gmail.com (Peter Stalman) --000000000000bd8a0705bdb7cb1b Content-Type: text/plain; charset="UTF-8" On Tue., Mar. 16, 2021, 23:49 Josh Di Fabio, wrote: > Imagine for a moment that you create a library, awesome-library-x, > which uses a PSR logger internally. You will most certainly allow that > logger to be injected into your library. Now imagine that some other > developer uses awesome-library-x in their application, and injects it > with a monolog logger that logs to some AWS service via the AWS SDK. > In turn, that logger indirectly uses Guzzle, which adds fiber support. > As a result, any functions in awesome-library-x which log something > become asynchronous. Two changes made by two developers unrelated to > awesome-library-x cause its code to be executed asynchronously. > > > Otherwise, if the library uses fibers internally it will have to resolve > them itself before continuing, no? If `capturePayment()` starts a fiber > then execution will not get to `setTransactionId()`, until it completed or > is handed of to a scheduler (again, which the developer would be aware of. > > > > So I don't think developers will face this race condition, unless they > are using framework like amphp and reactphp. But that's already the same > now, so if it's an issue it's not a new one with this RFC. > > It is a new issue. Today, interruptible functions must include a > `yield` statement, so they are explicitly interruptible. > No, they don't need to yield. You can do `$guzzleClient->requestAsync()` today, so how is it different? Thanks, Peter --000000000000bd8a0705bdb7cb1b--