From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.help Subject: Re: Fun with async processes Date: Tue, 01 Feb 2022 09:54:24 +0100 Message-ID: <87y22vq85b.fsf@elite.giraud> References: <87leyvyknv.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39473"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 01 09:59:18 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nEp0P-000A5L-NB for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Feb 2022 09:59:17 +0100 Original-Received: from localhost ([::1]:43004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEp0O-000531-IU for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Feb 2022 03:59:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEowV-00051o-RC for help-gnu-emacs@gnu.org; Tue, 01 Feb 2022 03:55:15 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:48205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEowJ-0008Ir-12 for help-gnu-emacs@gnu.org; Tue, 01 Feb 2022 03:55:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=BtW4/ia4PAJBH/1G CVJqxG5tAQ2F76RhmfRCl2Zddjc=; h=in-reply-to:date:references:subject: cc:to:from; d=ledu-giraud.fr; b=Au/7oPHaQV+HhQSgBRcE+xQIdjmM6GYioDRoQ3 SdUfZwKVATJ/GOc+q8EioQmndgdaol3IsRU1QI8LCho0xNCIvYGEheCcKbj6o2xVmec5z6 h1TLCtYErAWi2Lpb/qbbOG4Yac6jUB7yFAun/L/DGGrp2ub1XQduGGTD0tyrY9eKzkh8da +Grf7bSA5Tj+4BCtEmNET74W5zpxl/NSCPIVE2SSJ/Q09a+eN3a6i2Z+zdHl6QLsfpvdEV Lm7K6C7qyB2PIjK5b+ndVrHWkLcPqNiqeE0rdJhYpa9XnNVXvVnJt+KXnhnw3xLuLMH983 Jfwbq8ukL+IlTMZsY9QYLghw== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id b0c5f92a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 1 Feb 2022 09:55:00 +0100 (CET) In-Reply-To: (tomas@tuxteam.de's message of "Mon, 31 Jan 2022 16:56:00 +0100") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135618 Archived-At: writes: > An obvious approach is to have each sentinel call a "global" sentinel > which checks whether there are any processes still running (akin to your > myrun, only that it just gets called after each process's > termination). So I have to have an external variable that lists all the processes? > Alternatively (this is typically the approach I take) is to have one > sentinel (taking an arg) for all processes of interest. Then I call a > closure with that one parameter set to distinguish among the > "clients". Do you have an example or somewhere to look at in emacs for this approach? Thanks. -- Manuel Giraud