Commit 834ff123 authored by Linus Tolke Y's avatar Linus Tolke Y
Browse files

Continueing the prefetch-rewrite. The bugs get obscurer and obscurer.

parent 831db80f
Mon Aug 3 05:55:46 1992 Linus Tolke Y (linus@robin)
* async.el (lyskom-conf-fetched-p): required function.
* lyskom-rest.el (lyskom-go-to-next-conf): Prefetch of all
text-trees started on entrance.
(lyskom-end-of-command): Try to shut of prefetch while fetching
text to get next prompt.
* prefetch.el (lyskom-prefetch-limit): limit = 1;
MEMBERSHIPISREAD: new special type.
(lyskom-prefetch-one-item): Bugfix. lyskom-prefetch-textauth
shall fetch text-stat first.
lyskom-prefetch-texttree-handler): handle error. This is needed
in all the prefetch-function handlers.
* startup.el (lyskom-fetch-until-we-have-an-unread): New function
to be called from lyskom-end-of-command.
(lyskom-decide-unread-conf): sets lyskom-membership-is-read to t.
Sat Aug 1 17:45:37 1992 Linus Tolke Y (linus@robin)
* prefetch.el (lyskom-prefetch-membership-handler,
......@@ -371,7 +371,21 @@ The text is converted, before insertion."
;; Give a message if the user is waiting.
(lyskom-run 'async 'lyskom-default-new-text-hook text-stat)
(lyskom-run 'async 'lyskom-prefetch-and-print-prompt))
(lyskom-run 'async 'lyskom-print-prompt))
(defun lyskom-conf-fetched-p (conf-no)
"Return t if CONF-NO has been prefetched."
(let ((n (1- (length lyskom-membership)))
(result nil))
(while (and (not result)
(>= n 0))
(if (= (membership->conf-no (elt lyskom-membership n))
(setq result t))
(-- n))
(defun lyskom-add-new-text (recipient text-no local-no)
No preview for this file type
......@@ -124,7 +124,7 @@ See further documentation in the source code.")
;+++These should really be in vars.el:
(defvar lyskom-prefetch-limit 2
(defvar lyskom-prefetch-limit 1
"Number of prefetch requests the client will try to keep going
at a time.")
......@@ -147,9 +147,11 @@ at a time.")
"Prefetch the conf-stat for the conference with number CONF-NO.
If QUEUE is non-nil, put the request on it, otherwise put it on
(if conf-no
(if queue
(lyskom-queue-enter queue (cons 'CONFSTAT conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'CONFSTAT conf-no)))
(signal 'lyskom-internal-error "No argument to lyskom-prefetch-conf"))
......@@ -360,7 +362,7 @@ Return t if an element was prefetched, otherwise return nil."
;; Special request
((and (listp element)
(eq (car element 'MEMBERSHIPISREAD)))
(eq (car element) 'MEMBERSHIPISREAD))
(setq lyskom-membership-is-read t))
(t (signal 'lyskom-internal-error
......@@ -389,7 +391,7 @@ Return t if an element was prefetched, otherwise return nil."
((eq (car request) 'TEXTMASS)
(initiate-get-text 'prefetch 'lyskom-prefetch-handler (cdr request)))
((eq (car request) 'TEXTAUTH)
(initiate-get-text 'prefetch 'lyskom-prefetch-textauth-handler
(initiate-get-text-stat 'prefetch 'lyskom-prefetch-textauth-handler
(cdr request) queue))
((eq (car request) 'TEXT-ALL)
(initiate-get-text-stat 'prefetch 'lyskom-prefetch-text-all-handler
......@@ -435,8 +437,10 @@ Return t if an element was prefetched, otherwise return nil."
"Prefetch the conf-stat of the author of the text TEXT-STAT.
Put the request on QUEUE."
(if (not text-stat)
(lyskom-prefetch-conf (text-stat->author text-stat) queue)
(lyskom-queue-enter queue 'FINISHED)
(lyskom-queue-enter queue 'FINISHED))
(-- lyskom-pending-prefetch)
......@@ -473,6 +477,8 @@ Put the requests on QUEUE."
"Prefetch all info neccessary to write the text with text-stat TEXT-STAT.
Then prefetch all info (texttree) of comments.
Put the requests on QUEUE."
(if (not text-stat)
nil ; We did not get anything
(lyskom-prefetch-conf (text-stat->author text-stat) queue)
(lyskom-prefetch-textmass (text-stat->text-no text-stat) queue)
......@@ -493,7 +499,7 @@ Put the requests on QUEUE."
((eq type 'FOOTN-TO)
(lyskom-prefetch-textauth (misc-info->footn-to misc) queue))
(t nil))))
(lyskom-queue-enter queue 'FINISHED)
(lyskom-queue-enter queue 'FINISHED))
(-- lyskom-pending-prefetch)
......@@ -255,6 +255,7 @@ Optional argument CONF-STAT is used to check for a msg-of-day on the person."
(not (zerop (conf-stat->no-of-texts conf-stat))))
(lyskom-insert-string 'presentation-encouragement))
(setq lyskom-membership-is-read 0)
(setq lyskom-membership nil)
(setq lyskom-command-to-do 'unknown)
......@@ -321,6 +322,12 @@ Information required for this:
(let ((list (lyskom-array-to-list membership))
(lyskom-add-membership-to-membership membership)
(lyskom-fetch-until-we-have-an-unread list)))
(defun lyskom-fetch-until-we-have-an-unread (&optional list)
"Call to fetch info until we have decided if we have an unread. (or are done."
(let ((sent))
(while (and (not sent) list)
(if (and lyskom-unread-confs
(not (memq (membership->conf-no (car list))
......@@ -335,10 +342,11 @@ Information required for this:
(setq list (cdr list)))
(if sent
(if (numberp lyskom-membership-is-read)
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3
(let ((reverse (reverse lyskom-membership)))
(while reverse
(lyskom-prefetch-conf (membership->conf-no (car reverse)))
......@@ -377,6 +385,7 @@ If not, fetch next conf-stat from REST-MEMBERSHIPLIST."
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3
(setq lyskom-membership-is-read t)
(lyskom-run 'main 'lyskom-start-anew-login-3 'cont)))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment