Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126690 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 C6AE11A00BC for ; Mon, 10 Mar 2025 11:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741605065; bh=xTjOG6Bc1HPTpsO+ASDialroKHfc/j1+y9NIDgy11S4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YUx6hkH6lb860vYG7PaEVP75t9xiaZLSu4/83G74R6qtzyqJw+rzrZA2txHJcZoav f/POz6z1OABirrs2XZ7YoLe8xgII4A+YD5hGt2SRpxNHF71rqpawKdB3/Q9yS7PASe nmaYgjofh95zZIW22kW01FDlRP3TUqY8ax8yQnnVDD7+Co5zlP9yuYXUcc5pCECtVF K8myt808HIeXZJUzv8uV/j2RIaMpFIFSGhjXSTJt48NWhOazbl9rTC8vKxh0f0BwK4 U1Mf25DA9Esb4NLUpGuubNPTMVOeRqOc4EwRglFEJHNECIEEsr/Y0K4riK5womegix VtToyfDrQknLA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3002180388 for ; Mon, 10 Mar 2025 11:11:04 +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-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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, 10 Mar 2025 11:11:04 +0000 (UTC) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-6ef9b8b4f13so35971687b3.2 for ; Mon, 10 Mar 2025 04:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741605218; x=1742210018; 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=hoq1PnM28cgxuD0BsCMJVF0oEZMzUUIxi0icYDTD6OU=; b=d+xO9fnEp9hIyPPq7a7iovyIq/ziYzLclMcGch42V46d7IVGOUJSrn6AITehHK8bkS 2cHm2VKXJttNx5TUYFu53XrCyBIkAISUhfJITtQdDQQGapR719RHDCet6myja90ySXhu MBjPkZJqbuxuZ7Q3uLMuiL+Uk2xM72x94eI1sxf2WGR79jDA53xWSg4wD15rxvI6kgJe VAlfSVH0fCDV33GV4NnTXap/bCEob4BB2VkW/t0nNypIfpkRsEOhULm+2zJWMw5dikth gXRXyYdHCLzGxaqgjKTbYH1zY4J0jIANClgvuJeYBV0xA49B6igN221Sswrl0+AhWiot 5FlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741605218; x=1742210018; 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=hoq1PnM28cgxuD0BsCMJVF0oEZMzUUIxi0icYDTD6OU=; b=EiscssFeEgbZmJvSvUBCXFVfaFy8JKjzIo+SSEbZW5mx/Ai+rf2PjRqhyTLULuWFgG sSSH0KRTbW33GrJ/Dj7FHbleZ1wL8MKVng6usjwLy+pr02igWIRgpq5hXEkohJghSDmx HMNiHuXmmoLADtrsIPcTQuAbpUQfo2QIsio3lbbm5RgSz0NFZRz8nsfu42wzT4oRFOfd XzDoiMw+9Hj5zbpwOKe67wNLtoDmztAC+3007OHYSNoy7YwaNJXC85sAv0wsKxrbaNR8 A8Lo67GGHvJ8CZXv2L0vQgJjwBd9ZS1trBtU9sQt682hIe2A0PQ+uXEg52DYY6MqpWRo PyHg== X-Gm-Message-State: AOJu0YyJl2ynTKgaWGcFDuDwMd6DeZeSA07kZCXaeIHi/8TLfxcHqVKG /b5Z8iPvGxUBPO622P61QkjP7oNGTjZJy9/dTWoOiZIbFEduox1pVdBK5Kq+tECuR0pmHQ17Sv3 fixEjEg2HnYlAOoruXvnebnM/+DE= X-Gm-Gg: ASbGncu7VGrq+5GRS1/JaZOFs7nms7FmeLdTHbEDqayex8bErp+qCSfdbdQ4uUBKVd5 UD7efY248FxYVqtOkHvn8X5EVo7LerpH5TXZ6fy0eJZTfQJLn3rmWt/KtzXecrEWxqVIlMAbSz8 KbDqtEtRzEH0cNb4nt09z+XzdAMQ== X-Google-Smtp-Source: AGHT+IHhkj1xZ/vom2SbcpJmwsTni+pJqfHlQ6a6y3WfSRWT5+LD6bVqOEYPypYspU+W8AxF8nQMjnqo+jeSGmyZFZE= X-Received: by 2002:a05:690c:338f:b0:6f9:8b50:bac7 with SMTP id 00721157ae682-6febf35c3bdmr175641087b3.29.1741605218377; Mon, 10 Mar 2025 04:13:38 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <08c8ad0b-e8f4-46e3-99f0-b80748d40b89@app.fastmail.com> <07973EAE-2D83-47A8-8FA0-84286C77C02B@rwec.co.uk> <48d66433-3ae9-4895-8361-7c81a0a3670d@app.fastmail.com> <8599eb8b-d4a3-4cb8-899a-25b134e0d64d@gmail.com> <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> <77DC5F50-531D-49E8-8BE2-504A19CB5FFD@rwec.co.uk> <676e36e4-0b84-4d8c-b3db-2998831cd79d@gmail.com> <510B8EF1-9D07-41A8-9EA0-7D99CF7BFC91@rwec.co.uk> <4690cff0-7a48-4fe0-8310-688be253f976@gmail.com> <4871b2e4-353e-424f-92b9-7e2bb753bafa@gmail.com> <7D224BD3-2FF7-45E8-8D90-C9AEDC80DD4F@gmail.com> In-Reply-To: <7D224BD3-2FF7-45E8-8D90-C9AEDC80DD4F@gmail.com> Date: Mon, 10 Mar 2025 13:13:27 +0200 X-Gm-Features: AQ5f1Jq9fEPajk7vRJ7yE1TqApheNb2b7WvYhU6LOB3yTttxGmz9X0xjg5wJNnA Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC To: Daniil Gentili Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000061739e062ffb104f" From: edmond.ht@gmail.com (Edmond Dantes) --00000000000061739e062ffb104f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > Sure: > Yeah, this is a Watcher, a periodic function that is called to clean up or check something. Yes, it=E2=80=99s a very specific pattern. And of course, = the Watcher belongs to the service. If the service is destroyed, the Watcher should also be stopped. In the context of this RFC, it's better to use the Async\Interval class. > > contains multiple examples of tasks of the same kind in my own library (ping loops to keep connections alive, > read loops to handle updates (which contain vital information needed to keep the client running correctly) in the background, etc...), all started on > __construct when initialising the library, and stopped in __destruct when they are not needed anymore. > Thank you, I will read it. -- Ed. --00000000000061739e062ffb104f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>
>=C2=A0 Sure:
>

Yeah, this is a Watcher, a periodic = function that is called to clean up or check something. Yes, it=E2=80=99s a= very specific pattern. And of course, the Watcher belongs to the service. = If the service is destroyed, the Watcher should also be stopped.

In the context of this RFC, it's better to use the Async\Inter= val class.

>=C2=A0
>=C2=A0 contains multiple examples of tasks of the same kind in my own library (pin= g loops to keep connections alive,
> read loops to handle updates (w= hich contain vital information needed to keep the client running correctly)= in the background, etc...), all started on
> __construct when initi= alising the library, and stopped in __destruct when they are not needed any= more.
>=C2=A0

Thank you, I will read it.

--

Ed.

=
--00000000000061739e062ffb104f--