From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, NICE_REPLY_C,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27726 invoked from network); 4 Aug 2021 17:57:07 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 4 Aug 2021 17:57:07 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mBL8a-008wnn-KH for ml@inbox.vuxu.org; Wed, 04 Aug 2021 12:57:04 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1mBL8a-00D9ak-30 for ml@inbox.vuxu.org; Wed, 04 Aug 2021 12:57:04 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mBL8X-00D9aa-S7 for ding@lists.math.uh.edu; Wed, 04 Aug 2021 12:57:01 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mBL8V-00GevZ-Dm for ding@lists.math.uh.edu; Wed, 04 Aug 2021 12:57:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tZbuTAHlXX75LCub6mR/Bs5iTWOU2YyBqtFoXsrHkBk=; b=IL9USirlsiX5j39FonT7R45C1O HeU6xJIHsgcVIuxlqhExmWOxz08LgIobeYkZy79iFRodCMpJevWlmoV/kCd2U0MEePwGzEiqDrGOS Va+YbcjKMMMNWfO4nmvhCg7o14XalSrY7DCZ6Hb/HZe3E9J6jLQmfcSN2aDFwQlkaG94=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBL8N-0002NT-BN for ding@gnus.org; Wed, 04 Aug 2021 19:56:53 +0200 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mBL8L-0008mG-Eg for ding@gnus.org; Wed, 04 Aug 2021 19:56:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric Abrahamsen Subject: Re: Does article prefetching work on IMAP? Date: Wed, 04 Aug 2021 10:56:29 -0700 Message-ID: <878s1h5c1e.fsf@ericabrahamsen.net> References: <87r1fasaip.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:2YM7qh0sndsM0AzMdoe4Tze80Oc= List-ID: Precedence: bulk Pankaj Jangid writes: > Pankaj Jangid writes: > >> Eric Abrahamsen writes: >> >>> Pankaj Jangid writes: >>> >>>> Does article prefetching work with IMAP backend? If yes, then why it is >>>> required to have an active internet connection when reading article? >>> >>> No, right now it only works with nntp. In the past I've looked into >>> adding it for nnimap and it wouldn't be that hard, I just haven't gotten >>> around to doing it. >> >> Thanks for the information. > > Eric, could you please point me to a place where this should be > done? With some guidance, I should be able to do it. You mean write the code? That would be very welcome! Async/prefetching works by opening multiple connections to a single server. Those connections are stored and tracked in `nntp-connection-alist', for nntp, and `nnimap-connection-alist', for nnimap. nnimap.el has the code to handle multiple connections, but that functionality isn't currently used. The problem is in gnus-async.el, which is hard-coded to only work with nntp. I believe the only function that would need to be changed would be `gnus-async-wait-for-article', which currently calls `nntp-find-connection' and `nntp-accept-process-output': these calls would have to be abstracted to work with any server. Ideally we'd make *-find-connection a deffoo, and then add a `gnus-server-find-connection' function to gnus-int.el. I'm not sure how to handle getting rid of the `nntp-accept-process-output' call. Finally, you'd have to add: (deffoo nnimap-asynchronous-p () t) to nnimap.el, in order to set the whole thing in motion. I'm happy to help with further review or troubleshooting. Thanks! Eric