Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129435 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 6768A1A00BC for ; Mon, 24 Nov 2025 15:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763999200; bh=/vVmEvNrDAW1+tHWg3h67cSxw6MfbCXlQ8LTeTGX848=; h=References:In-Reply-To:From:Date:Subject:To:From; b=HXuTraYwfpWz3jSl4nzdGHcLn3zMkkQ0Kr4HAsGndwEVDXq9R5rbjkcVHuNJkQMHC fllXeLCs/jpRy+Lb7S57rMsYf4gTUxAWyfBmdz8ry+mFyKFj5lV/n3dbm07bJTh9KL tdnXHEVBBoVwV2e9D1/nOgm//ICxYISbKF4Ph59kpBT2+wrfRmAikTdBIOPwq7ykG5 eubOotX7zlWewb3SZ9iRo3Zu+z6akZXDLkheK50lJmmJpIygOPF7xDwO0hZxyi2Xhf zKs1prNW/bjxwga81qdrmgCBSH2hU7Yv68hThYBcOVtG3P5HGMAEWddeAAXbOe9VZV V+19gmBsomWaA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 681151801E7 for ; Mon, 24 Nov 2025 15:46:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 24 Nov 2025 15:46:38 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-3436cbb723fso3552500a91.2 for ; Mon, 24 Nov 2025 07:46:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=croquemonsieur-be.20230601.gappssmtp.com; s=20230601; t=1763999192; x=1764603992; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=/vVmEvNrDAW1+tHWg3h67cSxw6MfbCXlQ8LTeTGX848=; b=iJ1ZZ8J2lD7aafqvAC21QjxuXqrhZnHe94PDhmzYCl1ll7MUhslWYem3Yvp45RXUJ2 DU2i9NsSFLxPsneceSc1s2F7+nGjFEofG3ZzadOqtJZo8x87cXN3kK+9s07OSDAx+QLR SZqPqo1wbEzbPungPeSqv7zhFe058TouAu0EViSaaKyEUbzCDi44xHujjcGLgYsdayJ1 tTXxENhB6nMovGPsmOu5X37J6CACgTBbOnjy3nKB+QD+I4jRtQK6zKOnmCfhSkgcGO8k kKqY7cwChJElVPVcwXtiJaUW8L4ksuy2I9DN7op3QtYcYMzgomncxQq7s4j/RT6e0a11 hl3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763999192; x=1764603992; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/vVmEvNrDAW1+tHWg3h67cSxw6MfbCXlQ8LTeTGX848=; b=oaRu5lL8u6/CeR3xomcrpIDir6y7FjvPkwSu5Kbm1ZJ/pqPQM/8iyEtxw+4CN8o8PV u0kk+kH0Ef3bFgbPvvZxnAoYU25EVGrsWHlOYzLu6y8wQ7q+cUm6NZlR1NQflwfvoVqk otFFStTn3Kgm9MafcimLfRh9FaNdaUrpxssVw7Mj3fgsa4zEgw0QJ77yrj/wA9JMs3sm IvdYwhwo9hToEJk/zeRuloPSBsbL3GpYcp7lIBJ6KiWEpxQVDxwUp9fGvlaQ7c36EepA RsEmEh4UAn831LSClf8Luzer+QnjRgUxDQsm3RAat9efO/3jZW5xE+9NsutCZ6+pM+O5 S7Qg== X-Gm-Message-State: AOJu0Yz1dQN1B7s7EAAezPVh/lFqkHhvqptMIhCOx9S9sS7N8IeAeP/J gH4Y44RVdyauG2XWg2XAobcgaei//WPP76oXNr7t+E9CiMGHQQCecAiar+DE1fS+154HcRa20Rr Ld9vAlU9myi87XpFNIk9NqIt0+qoZM0mwDqXSTkKCnBfYFvmDTLTRz+F+UA== X-Gm-Gg: ASbGnctRNp05kPZ7qhi7DojwTi0Nsa+DI7zk5P5X7nQPp/To5DJO9d22pOiEuNCzSE8 JgX3d0h6jrTjKzmkM2bgVY9bFLY59ccIjr+H3v+fJ47C3AmBPzlTa4e3XSBmPCrApvv9r3Q+ygi ILEnJnXcjxSdqydYL1DwjwnY3wR4KOGcFvXfFhrPv+//WpBvwd1f5DOimodi6MNZ3U2+1FVyIJk qPAy/18lsmYxjA7m3vrp7DsO5qnCAz+Li7uFmttawVWN5APjbWENSURTdaK69Gws8nADTo+NUg1 2AyvOrqSLiU/QI8fKmK+kFOCdipe X-Google-Smtp-Source: AGHT+IEmIR9HRLIH5Xm4aqHMvsalUH7CxvfH/FYjz0+PEvZPOP8EwxMFprmLsK1hTZxzDHVkQi2FWIQBnelYFwGrKBg= X-Received: by 2002:a17:90a:c2c7:b0:32b:9774:d340 with SMTP id 98e67ed59e1d1-34733f43930mr11435799a91.33.1763999191882; Mon, 24 Nov 2025 07:46:31 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <2015208655.784984.1763811978476@email.ionos.de> <980296152.1071.1763813573083@email.ionos.de> <92865666.4510.1763818506332@email.ionos.de> <329450798.8037.1763822426377@email.ionos.de> <9287c46c-bc63-4dd0-9792-0f9421959589@rwec.co.uk> <65869feb-d518-4de3-8c10-115e3ba7dce7@rwec.co.uk> In-Reply-To: <65869feb-d518-4de3-8c10-115e3ba7dce7@rwec.co.uk> Date: Mon, 24 Nov 2025 16:46:20 +0100 X-Gm-Features: AWmQ_blFkM8R2g0x0KoQLNRBA3sdk4bzwQOXKGpx7lUbiIOZv4fHqm3sqPi-0Dw Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000376e350644591136" From: bart+php@croquemonsieur.be (Bart Vanhoutte) --000000000000376e350644591136 Content-Type: text/plain; charset="UTF-8" Op ma 24 nov 2025 om 15:03 schreef Rowan Tommins [IMSoP] < imsop.php@rwec.co.uk>: > - SDK Susie does not know what implementation of LoggerInterface will be > passed to her library. How does she know if it is safe to use in her > asynchronous code? As the LoggerInterface is injected into her SDK client and there is no distinction between an async and a sync Interface, Susie can't and doesn't really need to know this. She just uses the contract that is implied by the interface. > - Legacy Les is using a LoggerInterface implementation written years > ago. How does he know whether it is acceptable for use with Susie's library? As I see it, there's two kinds of "acceptable" in this case: blocking vs non-blocking and possible side effects. Blocking vs non-blocking: If Les does not care about blocking the event loop he can do whatever he wants. If he passes a Logger with a blocking I/O call (for example through some extension) the event loop would block for the duration of the I/O call. Acceptable in his case, as he does not seem to care about async. If Les wants to take advantage of non-blocking I/O he has to use a Logger which implements one of the non-blocking I/O functions (file_put_contents, ...). In this case I would expect the Scheduler to await that function call in the current coroutine. Is this correct Edmond? Possible side-effects: It is however possible that the expected output of the logs may have a different order than before Susie migrated her library from sync to async. Depending on how you look at it this might be a problem. I would expect Susie to release a new major version warning users of a possible break in backward compatibility. If Susie does not do that, Susie is at fault. If Susie does release a new major version I would expect Les to fix his dependency on shared state before upgrading to a new major version instead of blindly upgrading to a new version*. * which he shouldn't do anyways, async or not. Is this helpful? Best Regards, Bart Vanhoutte --000000000000376e350644591136 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Op ma 24 nov 2025 om 15:03 schreef Rowan Tommins [IMSoP] &= lt;imsop.php@rwec.co.uk>:
> - SDK Susie does not know what implementation of LoggerInterface = will be
> passed to her library. How does she know if it is safe to u= se in her
> asynchronous code?

As the LoggerInterf= ace is injected into her SDK client and there is no distinction between an = async and a sync Interface, Susie can't and doesn't really need to = know this. She just uses the contract that is implied by the interface.

> - Legacy Les is using a LoggerInterfa= ce implementation written years
> ago. How does he know whether it is= acceptable for use with Susie's library?

As I see it, there'= ;s two kinds of "acceptable" in this case: blocking vs non-blocki= ng and possible side effects.

Blocking vs non-bloc= king:
If Les does not care about blocking the event loop he can do whate= ver he wants. If he passes a Logger with a blocking I/O call (for example t= hrough some extension) the event loop would block for the duration of the I= /O call. Acceptable in his case, as he does not seem to care about async.
If Les wants to take advantage of non-blocking I/O he has to use a= Logger which implements one of the non-blocking I/O functions (file_put_co= ntents, ...). In this case I would expect the Scheduler to await that funct= ion call in the current coroutine. Is this correct Edmond?

Possible side-effects:
It is however possible that the expected= output of the logs may have a different order than before Susie migrated h= er library from sync to async. Depending on how you look at it this might b= e a problem. I would expect Susie to release a new major version warning us= ers of a possible break in backward compatibility. If Susie does not do tha= t, Susie is at fault. If Susie does release a new major version I would exp= ect Les to fix his dependency on shared state before upgrading to a new maj= or version instead of blindly upgrading to a new version*.

* = which he shouldn't do anyways, async or not.

Is this = helpful?

Best Regards,
Bart Vanhoutte

--000000000000376e350644591136--