Gnus development mailing list
 help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
Subject: Greg's Perennial Plea For an Asynchronous Backend Interface
Date: 03 Jan 2001 01:23:59 -0500	[thread overview]
Message-ID: <878zot5f28.fsf@localhost.freelotto.com> (raw)


So I go through this about every other year or so, I think this is my third
time. Periodically I get really frustrated that some gnus has tied up my emacs
doing some long network operation like downloading a few thousand news
headers, or expunging an imap mailbox, etc. For someone who lives entirely
within Emacs such things can be terribly frustrating. And it's completely
unnecessary.

No you don't need a threaded Emacs. 

Imagine if could pull down the complete summary of some huge newsgroup to do
searches while editing your files and composing replies in another group.

No you do *not* need a threaded Emacs. Really.

Imagine if when starting Gnus it initiated the check of the active file of all
20 slow news servers simultaneously and let you read from your main server
until they all respond or time out five minutes later.

No you do *not* need a threaded Emacs. Go away.

All you need is an interface between Gnus and the backends that allows Gnus to
pass a callback with a closure to the backend when an asynchronous call is
permitted. And of course you want to do this in a backwards compatible way, so
if the backend doesn't implement the asynchronous call Gnus just calls the
normal backend function. 

The backend of course needs to be written cleverly to make this possible. The
good news is that many of them already are. Because it's the most memory
efficient way to code process handling code in modern Emacsen many of the
backends implement their process handling code using after-change-hooks hooks
on the process buffer. These hooks get called asynchronously when the response
comes in, all they have to do is arrange to call Gnus' callback.

If anyone still doesn't believe me that these things do not require a threaded
Emacs consider this: I've already done it, back in 1996 when I originally
brought this up. 

My implementation uses a short cut(*) that wouldn't make sense in more than one
backend at a time. But the concept is proven. Emacs is perfectly responsive
while doing a large slow network operation. I can edit, compose, do all the
million other things I do within Emacs every day without getting blocked by
Gnus.

Doing it properly requires the new interface between backends and Gnus. And it
require Gnus be aware of when it's using the asynchronous interface to avoid
conflicts. But it would be much more powerful than my kludge.

(*) In case anyone's curious, the magic words are: recursive-edit :)

-- 
greg




             reply	other threads:[~2001-01-03  6:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03  6:23 Greg Stark [this message]
2001-01-03 15:55 ` Kai Großjohann
2001-01-04  1:26   ` Lloyd Zusman
2001-01-04 10:40 ` Steinar Bang
2001-01-05 10:30   ` Simon Josefsson
2001-01-05 16:41     ` Steinar Bang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878zot5f28.fsf@localhost.freelotto.com \
    --to=gsstark@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).