Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126413 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 0662C1ADAC9 for ; Fri, 14 Feb 2025 14:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739542429; bh=8oeyiiowpoyaHkBNy9vMy8vmWl0oX64a1wDXFQAiFGU=; h=References:In-Reply-To:From:Date:Subject:To:From; b=XUto3Q9THdVimhXQYez7IFYcXTpgmv9iMMhnb1kuDQ3bLrDoec061wokA/zKy4I8K YPxJJ+3D2+sxOW+QNZ7/RKSXBj6T7IsokSUzmLyG/pLCWYgbCdXrG4CggruDMCtrlE dg0/eDrZiY0QrTNS12svWp0paoqg9yUOanSQPUBNihsxG9TwFwzVD3kEaktVzDVs9J qOrnVKPhgmZ5wlcpxQXvqQ2+61KEwkPP4YT7Qdmaseap8to8TNGW2nvtbysRzWeNAj m1KORYSv5Wc0hAVcsGA3SLHrSEBeTA1fm9i3AYwG0B+lUDflWYTNiMJ0Q+JFGLbypA AmgjYI+wn1l3g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F3E5E1804C2 for ; Fri, 14 Feb 2025 14:13:45 +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=-1.2 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 ; Fri, 14 Feb 2025 14:13:43 +0000 (UTC) Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-e5dc299dee9so359184276.3 for ; Fri, 14 Feb 2025 06:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739542586; x=1740147386; 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=Ae9gUFNaCEXbrwQ/YeFxq/baSZcNdzOsK8+H14zjT10=; b=BYkCbo8lhdtI5CTFiOuIWWWJQfAqKhRDCsJCnG2CdX4tN/pjoXWxArz4K6ZU97AW2H fA4tSqOjk8MQPXBSWuVBpveVyrFVvZcW0LogcK21ij7eeLlgHcBuQ3ymM+qQ5tW8ZJNl 6RDODPPw992STnnp/lSK70kCQ1MYaRTZv4fE3vb5LGG4BWWI/pYoj25lmM9ue/oZMSBv okryMsrDSsK52UBHn8aeRXvXy2pgNCjOX24t1OgMwjklx/XauaBKYP3YVkfobVql3XFC XbVgVvVyJUlgnH/LS7E1eU1ql3JnrpOk08d6ABaVrPnrWELnBidksAwkaoUHQjwAqW9K waow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739542586; x=1740147386; h=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=Ae9gUFNaCEXbrwQ/YeFxq/baSZcNdzOsK8+H14zjT10=; b=XkxWB54hpqrdXVt1o8HNZAD8g9zqg46Oa9UxZ4lkaZRd1YqKhMlu+JK1GSbScd0isv 4hHbQaDiYjsUjxh6dzZLGP+HgXOonatEBcpeTYfgEccyBYrFT30vwONQrqrFxYUmfF3t QoYke5o8EmotuXgVgztomUxOeduw/709lu7cCgFj0Ut7EfTEAEih8TXD7khtFTJ/PkUw xixEmQ7Q9Hr/2u4JMX3kKSLvRcc4MU5jyZGIQSMq2SXh/jgwNKcElEZ/wQ7N4agbeBB9 j6DEMtkzieUg5HCt8hP2p0ADpcy4hNftQfu6TyiWHq8+UATrleDOAPKSVoHzqOIgiChg JGJA== X-Gm-Message-State: AOJu0YwXWSTk5yz1Map9G6sMHnclsS0xYtLm5VtBV5V5/LAGlqzGb8nQ TjcpkEI+KZoU4STiwyIKiJrUx6gRnuh/+MOjSaNRSSa6n1FSO+EHqyst3TwoiAO+tG1p+ZFj3wx 17Bgl16rdGukukzVnrUXVvsMsYxKQfVz0 X-Gm-Gg: ASbGncvVuKeSZXRAix9XSFSGmTfmoosGTMAj2E1Gp9hLW5icZC5Li62TvHwIWBIaAhD pkG2kv/sWjohI8MhWeOtgJZVm4ezgq69+HF2J/LPjDj/+Q4RyVFqGrs8hBcYNaKBDQeR7jNBf X-Google-Smtp-Source: AGHT+IE0mMhN+RlFF8avK6sBv+ht13VgJQ1MAH+fNMI/apRjMj9trmk/blhUNfJRl9MeK1XVXY4YbOwtjIDFXFzOHcY= X-Received: by 2002:a05:6902:1008:b0:e5b:2943:6215 with SMTP id 3f1490d57ef6-e5d9f12ffcemr12247093276.28.1739542585596; Fri, 14 Feb 2025 06:16:25 -0800 (PST) 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: Fri, 14 Feb 2025 16:16:14 +0200 X-Gm-Features: AWEUYZl6MfA8ZrlEpNgBjHs133dr67hzU2kjVKIUt0TnZAyleB2A34BcFQgmQTk Message-ID: Subject: Re: [PHP-DEV] PHP True Async To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000e2e677062e1ad179" From: edmond.ht@gmail.com (Edmond Dantes) --000000000000e2e677062e1ad179 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, *Jakub.* (It seems that simply clicking "Reply" does not work for the conference) *> *I understand that's not ready for review yet but quickly You could say that the code is in a state of "architectural stability," so it can be reviewed and criticized. (Unfortunately, only the Windows build is currently working.) In the near future, I plan to start documenting the C-API, where I will describe the implementation details in depth, but feel free to ask any questions about this component. Link: https://github.com/EdmondDantes/php-src/tree/async/async > Is there some particular reason why this is not an extension? There are two reasons: one objective and one relatively subjective. *The objective reason* is that there are critical changes that simply cannot be done in an extension. This includes modifying the logic of functions like php_select/php_poll2. The relatively subjective reason is that it was extremely difficult for me to design the architecture within the constraints of an extension because, at the start of the project, I had no clear idea of how to implement it at all... :) Theoretically, the project could be split into two separate components: core modifications and an external EXT component. Now that I have a working codebase, it would be much easier to do. And yes, you've raised a very important point. In CGI applications, this component is likely to be of little use (although in some cases, it might still be beneficial even for CGI). So keeping the entire codebase in the PHP core is not a good approach. I=E2=80=99m sure many people will point th= at out :) And I agree. But for now, the component is built using configuration options in buildconf, which is sufficient as a starting point. If your question is whether core modifications could be avoided, the answer is no. The whole purpose of this project is to make PHP more suitable for LongRunning Apps. > and then libuv optional part - similar to pdo for example. That's exactly how it has already been implemented! *LibUV* is not tightly coupled to the code. Moreover, it can be replaced on the fly with any other implementation=E2=80=94for example, Swoole can serve as the backend for the reactor, or RUST TOKIO, or perhaps someone might want to create something else. In essence, the Reactor is just an API and can be defined via an extension. LibUV is included as an embedded piece of code that can be compiled directly with the project if a specific flag is set, but of course, it can also be provided as an extension. (The reason why LibUV is provided as the "default solution" is that it is written in C and is cross-platform. This is important for PHP. ) I plan to do the same with the Scheduler component in the future. Thanks for questions! =D0=BF=D1=82, 14 =D1=84=D0=B5=D0=B2=D1=80. 2025=E2=80=AF=D0=B3. =D0=B2 15:0= 5, Jakub Zelenka : --000000000000e2e677062e1ad179 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,=C2=A0Jakub.
(It seems that simply clicking "Reply" does not work for the = conference)
<= br>
>=C2=A0I understand that's not ready for review y= et but quickly
=C2=A0 You could say that the code is in a = state of "architectural stability," so it can be reviewed and cri= ticized. (Unfortunately, only the Windows build is currently working.)=C2= =A0
In the near future, I plan to start documenting the C-API, wh= ere I will describe the implementation details in depth, but feel free to a= sk any questions about this component.=C2=A0=C2=A0

Link= :=C2=A0https://github.com/EdmondDantes/php-src/tree/async/async=

> Is there some particular reason why this is not an extension?
=

There are two reasons: one objective and one = relatively subjective.

The objective reason=C2=A0is that there= are critical changes that simply cannot be done in an extension. This incl= udes modifying the logic of functions like=C2=A0php_select/php_poll2.

The relatively subjective reason is that it was = extremely difficult for me to design the architecture within the constraint= s of an extension because, at the start of the project, I had no clear idea= of how to implement it at all... :)

Theoretically, the project could= be split into two separate components: core modifications and an external = EXT component. Now that I have a working codebase, it would be much easier = to do.

And yes, you've raised a very important point. In CGI appl= ications, this component is likely to be of little use (although in some ca= ses, it might still be beneficial even for CGI). So keeping the entire code= base in the PHP core is not a good approach. I=E2=80=99m sure many people w= ill point that out :) And I agree. But for now, the component is built usin= g configuration options in=C2=A0buildconf, which is sufficient= as a starting point.

If your question is whether core modifications = could be avoided, the answer is no. The whole purpose of this project is to= make PHP more suitable for LongRunning Apps.

> and then libuv optional part - similar = to pdo for example.

That's exactly how it has already been= implemented!=C2=A0LibUV=C2=A0is not tightly coupled to the code. Mo= reover, it can be replaced on the fly with any other implementation=E2=80= =94for example, Swoole can serve as the backend for the reactor, or RUST TO= KIO, or perhaps someone might want to create something else.

In essen= ce, the Reactor is just an API and can be defined via an extension.
LibU= V is included as an embedded piece of code that can be compiled directly wi= th the project if a specific flag is set, but of course, it can also be pro= vided as an extension. (The reason why LibUV is provided as the "defau= lt solution" is that it is written in C and is cross-platform. This is= important for PHP.=C2=A0 )

I plan to do the same with the Scheduler = component in the future.=C2=A0

Thanks for questions!

<= br>
=D0=BF= =D1=82, 14 =D1=84=D0=B5=D0=B2=D1=80. 2025=E2=80=AF=D0=B3. =D0=B2 15:05, Jak= ub Zelenka <bukka@php= .net>:

--000000000000e2e677062e1ad179--