Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126784 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 62C601A00BC for ; Sun, 16 Mar 2025 13:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742131927; bh=T8qTC41vMi9ByRu/J9DoRiktGaeRz5roZuAyxFfKc+I=; h=Date:Subject:To:References:From:In-Reply-To:From; b=VK/omQVQ/lHkvzMdTaQtx0wK1NrezPFVmxgHyZTn08YNtQp62sf2oilxCrYORtaZh ruySBrywbXReXPJJQwc4QJTVdSeZn3vpNxX3C3au68N41EBQZk5WWdD/iff7uYapDh nHM6TywuxtNNFTr40nSLD6Nk3lM7XVcFpcM3IPE7n3CnOcbwem9fHFZXZhqwU/PS5x hZ5Oblm+WETwzwhu/hgdbqHeSda9ur2rkzL6u0PhkO6rmEG+UaJoBEZLp0x8DoaKx/ iSJ7VIXFvzVqTuPY/jxkuv1zegCVthYhBY6NknySTPBwNcGuiLEuuFqaePOVDxhKf/ ZJX2IFjnlgyuQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C5C83180050 for ; Sun, 16 Mar 2025 13:32:06 +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=-2.3 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,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-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 ; Sun, 16 Mar 2025 13:32:06 +0000 (UTC) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43cfdc2c8c9so6419085e9.2 for ; Sun, 16 Mar 2025 06:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1742132077; x=1742736877; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=vNzHZ70WP0I3yifzZvScGsR+F4pu0xPNcvhfoaet/A4=; b=gI/5SYblhJrti+JeCpkYhzg/fGy7IdC+23fkhBXqRXy8czKuGZZgbXq9LOyXniPdGE tQfPNX3q8oUByjSeWuqQ4IAx5plEpCB053xcne3QKfXuFyVVmOjvjjYnC2/i7gGTG2Kb FcLI67UN5gmmW4z9/XkjKMjqgx6WJCOwjguUVvUVqOr3Ovp9yvGUSSw06pcqcbD0XCtC lNwiOmd4HJcxFynnmcomCfxnIp27Ei5kYmUq3DK1cfiYj7ffCcKWLGmU29A/koCVzGRQ bG6pfLwCG1HPFwsdtqVHkZzOqQlmZVbMEZqrAN2jMoWL4PPCpV0NiLd2hOpi4eYo1Iv1 o+WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742132077; x=1742736877; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vNzHZ70WP0I3yifzZvScGsR+F4pu0xPNcvhfoaet/A4=; b=R+wH0V3W07pouAJdNCHkxq+Z+W9BYod+Mq3bwPEinCVvqQ5l1zzA1lQDhIlRHnykEC tzTK7+uyBEaHM4BwjhEBvEj3N6TNtqiUBRCoyNUCm8NUs1csdhIAE3kiCFyhVXYcVCYQ QBny9NOEGhSG4CLaNFKn9K3q+F8dzcS91XWyWHuCuzXQTk59wUtoBzDkqpCMkVqUE/0d hhnmjIwZSbQ361PQ8tajGq5eu3ZYZGsaUcXqW4B+LUF7So/0RG3qMKMgniDQz6HTzCgb bgCuOeeWJE4osFXhx1GTJBJqEE3Hhu4o2IXxI09bmJW6FP2y6UkU8ysFO1Jr5Vkw1XaK JgBQ== X-Gm-Message-State: AOJu0YyDEJMI2y/FuVTZ9X3JBPRHeF+Mov2+2rfuxGYN6iTs9BzQzKr9 edjZ2gYtnp4eC3LztFJL7M95XbgrEZG02QMhKFkLYwQ0Qmn8WVntPz+FTNZO86n/rbJjj6AMuaN PTGo= X-Gm-Gg: ASbGncuQrXEYqCnvTy0LCTxYix12hAu5Hog7xrukqkItdJVUqS5yGak1JFYQ2ZI0Mn3 yFCXFJ7h30cjyTZn9nPCGxD9dMKEioZGVn4kqzL6MPF9PrMZlzYG7QSCWJDdfCwHC68BsSasQuR 60uNEWhLahgHqtoiXYGP6UmTgH6JXtXNj34HEg6818hpD9F+lYgA/uk0Elt+R7GK30R+9VPAzVE vwVyCpPU4Z4J7kYsAQMustInGCDthED8KH4H3W3b5VBt/c9+95dZCTwLkc9tnKmHfsWn3QGXm8v 5USlGC14zABdY/Bu3rC6lLyEdagbwPZrWjGKRy2swKyDSr3iZTaEB/vnQir5yJed38zsxdmjSZK qA5K5HiD6tmYE6BHy3XUyIsd08g== X-Google-Smtp-Source: AGHT+IEReMQMDiorEqY68DvrcbG7ROulF1od2RC/KoOpHy6Lxr3+BKReloZewaIc7ZbCsCCB+RRB5w== X-Received: by 2002:a5d:5c84:0:b0:397:8ef9:9952 with SMTP id ffacd0b85a97d-3978ef9a366mr9517784f8f.38.1742132077263; Sun, 16 Mar 2025 06:34:37 -0700 (PDT) Received: from ?IPV6:2a01:4b00:bf09:5101:d6f:6cb9:9e7d:1680? ([2a01:4b00:bf09:5101:d6f:6cb9:9e7d:1680]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-395c7df320csm11929127f8f.7.2025.03.16.06.34.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Mar 2025 06:34:36 -0700 (PDT) Message-ID: Date: Sun, 16 Mar 2025 13:34:34 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] PHP True Async RFC - Stage 2 To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: bilge@scriptfusion.com (Bilge) On 16/03/2025 09:24, Edmond Dantes wrote: > Good day, everyone. I hope you're doing well. > > https://wiki.php.net/rfc/true_async > > Here is a new version of the RFC dedicated to asynchrony. > > Key differences from the previous version: > > * The RFC is not based on Fiber; it introduces a separate class > representation for the asynchronous context. > * All low-level elements, including the Scheduler and Reactor, have > been removed from the RFC. > * The RFC does not include Future, Channel, or any other primitives, > except those directly related to the implementation of structured > concurrency. > > The new RFC proposes more significant changes than the previous one; > however, all of them are feasible for implementation. > > I have also added PHP code examples to illustrate how it could look > within the API of this RFC. > > I would like to make a few comments right away. In the end, the Kotlin > model lost, and the RFC includes an analysis of why this happened. The > model that won is based on the Actor approach, although, in reality, > there are no Actors, nor is there an assumption of implementing > encapsulated processes. > > On an emotional level, the chosen model prevailed because it forces > developers to constantly think about how long coroutines will run and > what they should be synchronized with. This somewhat reminded me of > Rust’s approach to lifetime management. > > Another advantage I liked is that there is no need for complex syntax > like in Kotlin, nor do we have to create separate entities like > Supervisors and so on. Everything is achieved through a simple API > that is quite intuitive. > > Of course, there are also downsides — how could there not be? But > considering that PHP is a language for web server applications, these > trade-offs are acceptable. > > I would like to once again thank everyone who participated in the > previous discussion. It was great! Looks tremendous, at a glance. Thanks for your work on this. Just one quick question for now; why is `suspend()` a function and not a statement? Cheers, Bilge