Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129778 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 836AC1A00BC for ; Sun, 18 Jan 2026 12:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1768739060; bh=TE//iB5+5s+9OD006XPh6zwLaNQGtlU3qV8+2ytmUkw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=X0UVq3gg9YNBwIWU9AFSYoiRByGHEKHv66/SEpdfGebrCp/PsoPgGpQH3br37Qg/m 98bsvN4Q48TtFAi7WJuCk583bz8PcxCNhG76A64C2BJNYRcLyZ6Y+2aw2+u4B84REn Stg/e1weQL6iPgi+V9+RBUOLYwZmuLsGnWnM3sUQki/BdwgUppKQevEgLPghOR03GM PrN25XjRaw6pa+Yzu01aVrYU4SOXwu5X+ht7gLLO0HENMoGgNlcuS4aiVQq5FmtD8W LqheHKdIStmXnbN/vGaaXJyI5uR5ck44bEvIE6+3HZ3XHFZaQ7Z/iPDplD8kOWpQS/ EDzokka/8N79A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5B19718058E for ; Sun, 18 Jan 2026 12:24:19 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 18 Jan 2026 12:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1768739038; bh=d9X4x/RQRzGphY8FSlF8F2xClahHbXWB/bjsRUMBs4I=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=itg12kivj6Xgj006QC5lHSYYAoBtlU8ltqz6gCq/T7WRT9SI/tM+u68x8nmSff//P trFHYtzJhyA6qNSpOXo1DzOCEvd+hy6DC342VuhbHZGhzmZmpwE9UXfiIyBSVHaa5d f8B+sfn1g+sD6ezHbmIpgcNcN7ljqdpr4BHBc2TXJ48lHwI2IPslmY7W3iIUcK08DS upwG4nqa69sbA7CwRNrj2f43Tej4qkjv58JySPKulnS7w6toPYAWhwFIx5mcqh93Rm HU+0DkrKY+GAxbfYV6XAAlq0GatU0wvDiN7a2PFU5LYq2Su5sUmNDi9AvhA0l7f8J/ C7zs3sRwzfoiw== Message-ID: <926a26a6-eb89-49aa-a387-6cc79caa29c1@bastelstu.be> Date: Sun, 18 Jan 2026 13:23:56 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Polling API To: Jakub Zelenka , PHP internals list References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 10/30/25 22:06, Jakub Zelenka wrote: > I would like to introduce a new polling API RFC that is part of my stream > evolution work: > > https://wiki.php.net/rfc/poll_api Since you made some larger changes to the RFC, rather than checking each change individually, I've taken another full look at the RFC and have the following remarks: - Context::wait() takes a millisecond timeout. This feels insufficiently granular. I am wondering if we should rather use either micro (as returned by microtime) or nanoseconds (as returned by hrtime) - or possible an instance of DateInterval (which would use microsecond resolution). - For Handle: I assume that getFileDescriptor() should be abstract? - For Handle I am wondering about abstract class vs interface. Since the Handle presumably doesn't have any non-abstract methods, an interface feels more correct / more flexible. - For Handle: What happens if I extend this class in userland and attach it to a Context. Will things break? What if I return the number of a non-existent FD? - For the stubs: It would be useful if you used the “generics notation” for the array returns. e.g. `@return list` for Backend::getAvailableBackends(). This makes it easier to understand how exactly the result will look like to check for mistakes / suboptimal choices. - InactiveWatcherException: This one feels more like a programmer error, so should possibly be a PollError / InactiveWatcherError (but I don't know enough about the topic to be sure). - Internal API: For php_poll_wait(), the timeout should probably be a struct timespec for future-proofing. - Policy-wise: I just added the Abstain option to the voting widget. - Examples: I like them. They nicely showcase how the API works! Best regards Tim Düsterhus