Subject: bug#38807: [Feature request]: Support lisp workers like web workers.

From: Eli Zaretskii <[email-masked]>
Date: Mon, 06 Jan 2020 18:07:12 +0200

> Date: Mon, 6 Jan 2020 13:08:28 +0800
> From: HaiJun Zhang <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
>  Sorry, such general and vague suggestions aren't useful. You need to
>  propose specific changes that are consistent with how Emacs is
>  designed and implemented. You need to describe those new APIs, and
>  you need to tell how will they be used by the existing code that
>  displays messages in the echo area.
> 
> On the UI part, create a worker like this:
> ——————xxxx——————
> fetch_mail_worker = new Worker(xxx)
> 
> fetch_mail_worker.onmessage = function (msg) {
>     // display the new mail
> };
> 
> fetch_mail_worker.onerror = function (error) {
>     message(“fetch mail error: %s”, error)
> };
> 
> fetch_mail_worker.start()
> ——————xxxx———————
> 
> On the worker part, fetch emails and post messages or error:
> ——————xxxx———————-
> while(true) {
>     error = fetch_next_mail(&msg)
>     if error != nil {
>        post_error(error)
>        break
>     }
> 
>     post_message(msg)
> }
> ——————xxxx———————-

This is very abstract.  I hoped you could describe this in terms of
relevant Emacs APIs and features.