From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38807: [Feature request]: Support lisp workers like web workers. Date: Sat, 04 Jan 2020 10:59:45 +0200 Message-ID: <83k167ha0u.fsf@gnu.org> References: <83o8vpn8g1.fsf@gnu.org> <87mub9u0ld.fsf@gmx.de> <878smrtu65.fsf@gmx.de> <83r20hhyhi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="8301"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38807@debbugs.gnu.org, michael.albinus@gmx.de To: HaiJun Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 04 10:00:17 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1infI5-0001we-OG for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jan 2020 10:00:13 +0100 Original-Received: from localhost ([::1]:60718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1infI4-0004cv-89 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jan 2020 04:00:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33447) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1infHv-0004aD-LO for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 04:00:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1infHu-0003JM-HK for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 04:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1infHu-0003I0-CR for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 04:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1infHu-0007t1-AD for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2020 04:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2020 09:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38807 X-GNU-PR-Package: emacs Original-Received: via spool by 38807-submit@debbugs.gnu.org id=B38807.157812839230269 (code B ref 38807); Sat, 04 Jan 2020 09:00:02 +0000 Original-Received: (at 38807) by debbugs.gnu.org; 4 Jan 2020 08:59:52 +0000 Original-Received: from localhost ([127.0.0.1]:42444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1infHk-0007s9-3w for submit@debbugs.gnu.org; Sat, 04 Jan 2020 03:59:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1infHi-0007rw-5h for 38807@debbugs.gnu.org; Sat, 04 Jan 2020 03:59:50 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1infHc-0001aH-1Q; Sat, 04 Jan 2020 03:59:44 -0500 Original-Received: from [176.228.60.248] (port=2441 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1infHb-00038R-E5; Sat, 04 Jan 2020 03:59:43 -0500 In-reply-to: (message from HaiJun Zhang on Sat, 4 Jan 2020 13:19:46 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174150 Archived-At: > Date: Sat, 4 Jan 2020 13:19:46 +0800 > From: HaiJun Zhang > Cc: michael.albinus@gmx.de, 38807@debbugs.gnu.org > > How do you write a useful Lisp application for a thread if you have no > way of displaying any messages? > > Workers are background workers. They don’t display messages directly. They post the error messages to the > UI part of the lisp application. How would that work? We don't have any such message queues in Emacs, and no machinery to display them, nor for telling the user which job reported the message. And again, some low-level Lisp functions issue messages when they like that, out of the application's control. What do you do with those? > For a lisp application such as an email client, it is splitted to two parts: the UI part and the worker part. The UI > part may has two callbacks(or event handlers): > 1. on_new_email > 2. on_error > > If the worker fetches an email successfully, it sends an event to the UI part and the on_new_email callback of > the UI part will be called. If the worker fails, it sends an error to the UI part and the on_error callback will be > called. The on_error callback can display the error message to user. I'm saying that fetching email doesn't need any Lisp, it can be done in C. And if so, you don't need Lisp-level threads at all.