Re: Getting only latest X messages of a newsgroup
Chris Burdess <[email protected]> Tue, 1 Aug 2006 08:36:51 +0100
| Newsgroups | gmane.comp.java.classpath.extensions.discuss |
|---|---|
| Message-ID | <[email protected]> |
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============1098716771== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-2-16952384" Content-Transfer-Encoding: 7bit This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-2-16952384 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed [email protected] wrote: >>> I see two ways: >>> >>> - Get at most X latest articles: fetching the message headers using >>> (last - X) or first -> last as the range in NNTPFolder.getMessages() >>> >>> - Get exactly the X latest articles: fetching the message headers >>> using first -> last and keeping only the latest X messages >>> >>> Either way, the internal cache is used to prevent queries for >>> previously downloaded messages. >>> Once the getMessages() returned the array of X recent messages, >>> their full content can be downloaded using fetch(Message[], >>> FetchProfile) >>> >>> There would be one property (for example >>> 'mail.nntp.limittolatest' ) that states the number of messages to >>> download at most or exactly. >>> This property should be read each time before being used so that a >>> client could change the value before fetching each newsgroup. >> >> I kind of see where you're going with this, but doesn't it change the >> semantics of getMessages? Wouldn't it be better just to concentrate >> on optimising the range passed to xhdr, and instead manage the >> messages' RECENT flags to indicate which ones were new in the last =20= >> call? >> >> I'm not sure at all about returning fewer messages than are actually >> present. > > This is a behaviour changed by properties similar to the way 'list =20 > folder' does > not return all folders by default... Yes; I can't say I was very happy about having to do that either but =20 at least there is a directly corresponding NNTP artifact. > Can you explain a little bit how you see the recent flag operation ? Say we have already performed a getMessages which retrieved articles =20 450-500 and the latest article range (from the group command) is =20 460-550. On getMessages, we would mark all the cached articles as not =20= RECENT, do an xhdr for the range 501-550 and mark any newly retrieved =20= articles as RECENT (note that it might not retrieve any new articles =20 at all because of cancellations). We would then return all the =20 messages from 460-550 from getMessages, and their flag state would =20 indicate which of them had been retrieved as part of the call. Note that the xhdr only retrieves a list of Message-IDs from the =20 server, so it really shouldn't take all that long even for large =20 numbers of articles assuming the server supports xhdr (if not it =20 really is inefficient). --=20 =E7=8A=AC Chris Burdess "They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety." - Benjamin Franklin --Apple-Mail-2-16952384-- --===============1098716771== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Classpathx-discuss mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpathx-discuss --===============1098716771==--