Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127130 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 qa.php.net (Postfix) with ESMTPS id 95AC91A00BC for ; Thu, 17 Apr 2025 08:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744879937; bh=PJn2E/gVvTEhGR6U74yA9iF02OqEC61qtboWPWulQjA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RB3KkCRC0zyl/apZ+l+pq3UI0T5xDCgksMwuHy+FTKK30TqRyBp/P6d2yvX6rC7ri I9vMG1j+AGrVkLcsO+h4PgfgL3ACY/O+rbIUhh7xC3cGYwlIRB3EaJniQkpLWyt+qO Itnx3VTBkLocb9X7s4DEWopf0xRHD/MyRRco5iOz31YOYYYAoWGsoG0Lkpah+SlzrG bFyYgmtHmgaCKj8GNu5q2OVFWS9Us/EhAJiJPHXvEaZ47Ioza6LUb+5AWzI2zWQXE0 4o62cQ+VlXePTaCsH1BWCe93caDevfKrBZdCM53tNxYsG47hXX1XEdhbQBfe+nPX9A c9IN0IvQE4ebg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 25A6518007C for ; Thu, 17 Apr 2025 08:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 ; Thu, 17 Apr 2025 08:52:16 +0000 (UTC) Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-e6a8aa771e8so487105276.3 for ; Thu, 17 Apr 2025 01:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744880077; x=1745484877; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fhyhcqrh/3YsAwVdlNxyBZlNf1DTvgcjcHPUie1mdrI=; b=Q8q2uaVJY4cPkHs35gxCsgUzl//NhEo6rVjXJhX7g4EYZHaleBHekTbfAcB6/vRd8G MtP5Dr4agGhrBSBj5tu6qFgpdo7SuiQdTpimlVcRmFYQupCPrY+YNp1xvCHqE1V1+wbI MB9ImajxD2AX6NpBADG5hmr6qdG4cbqcKQe+zUkkN00ZGfTc/d1S2MgZswrMmwhJ/qYN bquhH/JnF2N7TZfzpwtM4Vrcoa8YKLeCn8xuGpCvv/o5+Zq0gVP793vQtmjqJPrnK94M 2FpIXrsyhWsjLg9CL6XP0EqeKkw2sP/wdLRGFlXBMdaNIY5yBwscbxPo1ieSDrPq3i90 F82A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744880077; x=1745484877; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fhyhcqrh/3YsAwVdlNxyBZlNf1DTvgcjcHPUie1mdrI=; b=Et7mklxpphVcMZOiqRS2d9poGcMg4hNL0Cpx1rarqqybmMiiE1wUJq4vb3lwnsjj5M hIc/q9floJviQeN/7xkz8kNaiDO6b5BeQiqsHJP6ga6xJuvaNsIGcmcnHxSnpmoxSiUu UA0lIz2iqxzRllHlp2tU7uM/+0acDYy/FuIewCvlM6+SRLHLSXQhRdMrZ1kpEWPmu76p C/519PvyadISqGUI5uV1X3CNsxsL2OywyJCNYXw/MsSM4r5OwCXxVFprHgQsRIHiIyQF wJxxXRH9uPAQshgixyAl9Y4d1qn4gHym+N1k+5w/Y2sJ64DwQQVqJMj0anD4k40oHmeP 1hNw== X-Gm-Message-State: AOJu0YwWewOAK7arGfKI5uJ8sGU7n9YYB08fS8jFLGM0WxP4eQY7rwUe 6cthaXdEbjO+YuxWR+ZDoZGbCT63Xe+EX6wvcaYbobHLKmUJGIiyoBHKmo7uK2bO4IS6MSbbn3W kK+4nTqjTJTXKntqBWn+NsJ6/nWXMJVY8MfU= X-Gm-Gg: ASbGnctN5hETbTmMYtG7ETgaed3gfQPfcvHfxyGcxMl4wj6eYuL7JeWA2yovZWjDwNu Zr8SxNSOV7pjipzg+gTUvKBTnioavlvhXzWPBUTArDSdDgaMQjOL8BwwPsIrdbn0frIcjoyO7UP xbHrrH3vLeWjzIinLtEOMb/w== X-Google-Smtp-Source: AGHT+IFe+lmaR3olZgLju7hKla2tYqTt8Udq7vKUlFAo2lZZsuGS+6NdLZAQg5340+7i35/XdSWvP3vqDR+9fIdynn4= X-Received: by 2002:a05:6902:1688:b0:e5b:3823:4176 with SMTP id 3f1490d57ef6-e72758eb7ecmr6826816276.13.1744880077451; Thu, 17 Apr 2025 01:54:37 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 17 Apr 2025 11:54:26 +0300 X-Gm-Features: ATxdqUHz2E6cIrxmHGh2PeGaY74ERv_JbvDeNhPTXOT_RnVsKWHdsrUm3WW2psE Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC Stage 3 To: "Rowan Tommins [IMSoP]" Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000313cf00632f58d52" From: edmond.ht@gmail.com (Edmond Dantes) --000000000000313cf00632f58d52 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Rowan! > I don't have time to dig into the details of this draft at the moment, but will say that a vote in two weeks is not at all realistic. I just used the Flow from the Wiki. :) > My only other comment at a very quick glance is that I see the Context section is still included, and still has most of its complexity. Almost every section of the RFC has a "Motivation" subsection, which explains why a particular tool is needed and what problem it solves. I removed everything from the RFC that is not directly related to asynchrony or not essential at this stage. Yesterday I also received feedback that the RFC contains too many changes, so I can briefly summarize what=E2=80=99s new in this version compared to t= he previous one: 1. The Scope class can no longer be used in an await expression. A separate method is now provided for waiting on a Scope, intended only for special use cases. 2. Scope is now responsible solely for coroutine lifetime and error handling. 3. A TaskGroup class has been added for working with groups of tasks. It is used explicitly with the expression spawn with $taskGroup. Together with Scope, TaskGroup supports structured concurrency, offering different strategies for tracking hanging coroutines. *These are the key changes.* *Secondary changes include:* 1. Syntax refinement 2. Edge case handling 3. Ability to extend spawn with logic 4. Added combinator functions: all, any, anyOf, ignoreErrors 5. A special function Async\protect() has been added for critical sections that cannot be cancelled. 6. Improved examples Contextual expressions like with $context and async blocks were removed from the RFC as they are out of its scope. The next important step is to determine which coroutine model to choose. There are three models in total: 1. Go =E2=80=93 no Scope 2. Java Loom =E2=80=93 Scope is always passed explicitly 3. The current RFC =E2=80=93 Scope is passed both explicitly and implicitly The choice of model affects both the syntax and the API. Therefore, if the current model is not accepted, there is no point in further developing this RFC =E2=80=94 a new one should be created instead. This is the key question I want to clarify at this stage. -- Ed --000000000000313cf00632f58d52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello, Rowan!

> I don't have time to dig into the details of this draft = at the moment, but will say that a vote in two weeks is not at all realisti= c.
I just used the Flow from the Wiki. :)

> My only other comment at a very quick glance is tha= t I see the Context section is still included, and still has most of its co= mplexity.
Almost every section of the RFC has a "= ;Motivation" subsection, which explains why a particular tool is neede= d and what problem it solves.=C2=A0
I removed everyth= ing from the RFC that is not directly related to asynchrony or not essentia= l at this stage.=C2=A0=C2=A0

Yesterday I also received feedba= ck that the RFC contains too many changes, so I can briefly summarize what= =E2=80=99s new in this version compared to the previous one:

  1. The Scope class can no longer be used in a= n await expression. A separate method is now provided for wait= ing on a Scope, intended only for special use cases.

  2. Scope is now responsible solely for corout= ine lifetime and error handling.

  3. A TaskGroup class has been added for worki= ng with groups of tasks. It is used explicitly with the expression sp= awn with $taskGroup. Together with Scope, TaskGro= up supports structured concurrency, offering different strategies fo= r tracking hanging coroutines.

These are the key changes.
=

Secondary changes include:

  1. Syntax refinement

  2. Edge case handling

  3. Ability to extend spawn with logic

  4. Added combinator functions: all, any= , anyOf, ignoreErrors

  5. A special function Async\prot= ect() has been added for critical sections that cannot be cancelled.=C2=A0= =C2=A0

  6. Improved examples

Contextual expressions like with $context and async= blocks were removed from the RFC as they are out of its scope.=C2= =A0

The next important step is to determine which = coroutine model to choose. There are three models in total:
  1. Go =E2=80=93 no Scope

  2. Java Loom =E2=80=93 Scope is always passed explicitly

  3. The current RFC =E2=80=93 Scope is passed both explicit= ly and implicitly

The choice of model affects both the syntax and the API= . Therefore, if the current model is not accepted, there is no point in fur= ther developing this RFC =E2=80=94 a new one should be created instead.

=

This is the key question I want to clarify at this stag= e.=C2=A0=C2=A0

--

Ed

--000000000000313cf00632f58d52--