Commit d3303f8b authored by Linus Tolke Y's avatar Linus Tolke Y
Browse files

Continueing prefetch rewriting. Login is now possible.

parent ca059b44
Thu Jul 30 03:54:50 1992 Linus Tolke Y (linus@lysator)
* startup.el (lyskom-start-anew-login-3): Started the prefetch
*after* stacking all entry prefetch-defaults.
* prefetch.el (lyskom-prefetch-map-handler): Bugfix when entering
new read-infos.
* prefetch.el (lyskom-prefetch-who-is-on, lyskom-prefetch-mark):
Rewritten to be suspended in the prefetch-stack.
* prefetch.el, startup.el (lyskom-prefetch-membership-handler,
lyskom-append-to-membership): Now we check if we have already
gotten this one and if so, don't enter it and correct the count.
Defensive programming!
* prefetch.el (lyskom-prefetch-text, lyskom-prefetch-textall,
lyskom-prefetch-text, lyskom-prefetch-texttree,
lyskom-prefetch-pers): Bug-fix.
Mon Jul 27 01:14:24 1992 Linus Tolke Y (linus@lysator)
* lyskom-rest.el: Removed obsolete lyskom-prefetch-* functions.
......
......@@ -75,6 +75,9 @@ lyskom-queue.
The next part of the map in conference CONF-STAT.
The length fetched per revolution is according to
the value of lyskom-fetch-map-nos.
('MARKS) - The whole list of marked texts and then every info about
these texts.
('WHOBUFFER) - The who-is-on-info to construct the who-buffer.
('MEMBERSHIP . pers-no) -
The next part of the membership for person PERS-NO
is fetched. How long we already have fetched is
......@@ -83,7 +86,6 @@ lyskom-queue.
are done.
For every membership-part we fetch the conf-stats
before continuing with the next part.
See further documentation in the source code.")
......@@ -155,8 +157,8 @@ lyskom-prefetch-stack."
If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack."
(if queue
(lyskom-queue-enter queue (cons 'PERSSTAT conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'PERSSTAT conf-no)))
(lyskom-queue-enter queue (cons 'PERSSTAT pers-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'PERSSTAT pers-no)))
(lyskom-continue-prefetch))
......@@ -165,8 +167,8 @@ lyskom-prefetch-stack."
If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack."
(if queue
(lyskom-queue-enter queue (cons 'TEXTSTAT conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTSTAT conf-no)))
(lyskom-queue-enter queue (cons 'TEXTSTAT text-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTSTAT text-no)))
(lyskom-continue-prefetch))
......@@ -175,8 +177,8 @@ lyskom-prefetch-stack."
If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack."
(if queue
(lyskom-queue-enter queue (cons 'TEXTMASS conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTMASS conf-no)))
(lyskom-queue-enter queue (cons 'TEXTMASS text-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTMASS text-no)))
(lyskom-continue-prefetch))
......@@ -185,8 +187,8 @@ lyskom-prefetch-stack."
If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack."
(if queue
(lyskom-queue-enter queue (cons 'TEXTAUTH conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTAUTH conf-no)))
(lyskom-queue-enter queue (cons 'TEXTAUTH text-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTAUTH text-no)))
(lyskom-continue-prefetch))
......@@ -195,8 +197,8 @@ lyskom-prefetch-stack."
If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack."
(if queue
(lyskom-queue-enter queue (cons 'TEXT-ALL conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXT-ALL conf-no)))
(lyskom-queue-enter queue (cons 'TEXT-ALL text-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXT-ALL text-no)))
(lyskom-continue-prefetch))
......@@ -205,8 +207,8 @@ lyskom-prefetch-stack."
If QUEUE is non-nil, put the request on it, otherwise put it on
lyskom-prefetch-stack."
(if queue
(lyskom-queue-enter queue (cons 'TEXTTREE conf-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTTREE conf-no)))
(lyskom-queue-enter queue (cons 'TEXTTREE text-no))
(lyskom-stack-push lyskom-prefetch-stack (cons 'TEXTTREE text-no)))
(lyskom-continue-prefetch))
......@@ -245,16 +247,19 @@ lyskom-prefetch-stack."
(defun lyskom-prefetch-marks (&optional queue)
"+++"
(initiate-get-marks 'main 'cache-set-marked-texts)
nil)
"Prefetches the list of marked texts. Then all texts are fetched."
(if queue
(lyskom-queue-enter queue (list 'MARKS))
(lyskom-stack-push lyskom-prefetch-stack (list 'MARKS)))
(lyskom-continue-prefetch))
(defun lyskom-prefetch-who-is-on (&optional queue)
"+++"
;;(cache-initiate-who-info-buffer) +++do it later this way
(initiate-who-is-on 'prefetch 'cache-initiate-who-info-buffer)
nil)
"Prefetches the list of persons on the system."
(if queue
(lyskom-queue-enter queue (list 'WHOBUFFER))
(lyskom-stack-push lyskom-prefetch-stack (list 'WHOBUFFER)))
(lyskom-continue-prefetch))
;;; ================================================================
......@@ -345,7 +350,8 @@ Return t if an element was prefetched, otherwise return nil."
((and (listp element)
(memq (car element)
'(TEXTAUTH TEXT-ALL TEXTTREE
CONFSTATFORMAP MAP MEMBERSHIP)))
CONFSTATFORMAP MAP MARKS
MEMBERSHIP WHOBUFFER)))
(let ((queue (lyskom-queue-create)))
(setcar prefetch-list queue)
(lyskom-prefetch-one-request element queue)
......@@ -406,6 +412,10 @@ Return t if an element was prefetched, otherwise return nil."
(nth 1 request)
(+ lyskom-fetch-map-nos (nth 2 request))
queue))
((eq (car request) 'MARKS)
(initiate-get-marks 'prefetch 'lyskom-prefetch-marks-handler queue))
((eq (car request) 'WHOBUFFER)
(initiate-who-is-on 'prefetch 'lyskom-prefetch-whobuffer-handler queue))
(t (signal 'lyskom-internal-error
(list "lyskom-prefetch-one-request - unknown key:"
(car request))))))
......@@ -482,16 +492,25 @@ Put the requests on QUEUE."
(lyskom-start-prefetch))
(defun lyskom-prefetch-membership-handler (membership-part pers-no queue)
(defun lyskom-prefetch-membership-handler (membership pers-no queue)
"Handle the return of the membership prefetch call."
(lyskom-stop-prefetch)
(let ((list (lyskom-array-to-list membership-part)))
(let ((list (lyskom-array-to-list membership)))
(while list
(lyskom-prefetch-conf (membership->conf-no (car list)) queue)
(if (memq (membership->conf-no (car list))
(mapcar (function membership->conf-no) lyskom-membership))
(if (numberp lyskom-membership-is-read)
(-- lyskom-membership-is-read))
(setq lyskom-membership (append lyskom-membership (list (car list)))))
(setq list (cdr list)))
(setq list (lyskom-array-to-list membership))
(while list
(lyskom-prefetch-map (membership->conf-no (car list))
(membership->last-text-read (car list))
queue)
(setq list (cdr list)))
(setq lyskom-membership (append lyskom-membership list))
(if (and (numberp lyskom-membership-is-read)
(< (length membership-part) lyskom-fetch-membership-length))
(< (length membership) lyskom-fetch-membership-length))
(setq lyskom-membership-is-read 'almost)
(setq lyskom-membership-is-read (+ lyskom-membership-is-read
lyskom-fetch-membership-length))
......@@ -524,16 +543,34 @@ Maps are `cached' in lyskom-to-do-list."
(if (read-list-enter-text (car list) conf-stat lyskom-to-do-list)
(setq list (cdr list))
(let ((info (lyskom-create-read-info
'CONF conf
'CONF conf-stat
(membership->priority
(lyskom-member-p (conf-stat->conf-no conf)))
(lyskom-member-p (conf-stat->conf-no conf-stat)))
(lyskom-create-text-list list))))
(read-list-enter-read-info info lyskom-to-do-list))))))
(read-list-enter-read-info info lyskom-to-do-list)
(setq list nil))))))
(lyskom-queue-enter queue 'FINISHED)
(-- lyskom-pending-prefetch)
(lyskom-start-prefetch)
(lyskom-set-mode-line))
(defun lyskom-prefetch-marks-handler (marks queue)
"Handle the list of marked texts."
(cache-set-marked-texts marks)
(lyskom-stop-prefetch)
(let ((list (cache-get-marked-texts)))
(while list
(lyskom-prefetch-text-all (mark->text-no (car list)) queue)
(setq list (cdr list))))
(-- lyskom-pending-prefetch)
(lyskom-start-prefetch))
(defun lyskom-prefetch-whobuffer-handler (who-is-on queue)
"Handle the who-is-on info. The goal here is to get an updated who-buffer."
(cache-initiate-who-info-buffer who-is-on) ;+++ should be done later
)
(defun lyskom-prefetch-handler (&rest data)
"Handler called after each simple prefetch request is done."
......
......@@ -255,7 +255,6 @@ 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))
(lyskom-setup-prefetch)
(lyskom-start-prefetch)
(setq lyskom-membership-is-read 0)
(setq lyskom-membership nil)
(setq lyskom-command-to-do 'unknown)
......@@ -263,16 +262,19 @@ Optional argument CONF-STAT is used to check for a msg-of-day on the person."
(setq lyskom-options-done)
(setq lyskom-to-do-list (lyskom-create-read-list))
(setq lyskom-reading-list (lyskom-create-read-list))
(initiate-get-unread-confs 'main 'lyskom-register-unread-confs pers-no)
(initiate-get-unread-confs 'main 'lyskom-register-unread-confs
lyskom-pers-no)
(lyskom-read-options) ; Check this to be finished before
; printing the first prompt
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3 pers-no
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3
lyskom-pers-no
lyskom-membership-is-read
lyskom-fetch-membership-length)
(lyskom-prefetch-all-conf-stats)
(lyskom-prefetch-marks)
(lyskom-prefetch-who-is-on)
(lyskom-prefetch-membership pers-no))))
(lyskom-prefetch-membership pers-no)
(lyskom-start-prefetch))))
(defun lyskom-register-unread-confs (unread-confs)
......@@ -317,11 +319,14 @@ Information required for this:
"Adds a PART last in the membership-list."
(let ((list (lyskom-array-to-list membership))
sent)
(setq lyskom-membership (append lyskom-membership list))
(let ((reverse (reverse lyskom-membership)))
(while reverse
(lyskom-prefetch-conf (membership->conf-no (car reverse)))
(setq reverse (cdr reverse))))
(while list
(if (memq (membership->conf-no (car list))
(mapcar (function membership->conf-no) lyskom-membership))
(if (numberp lyskom-membership-is-read)
(-- lyskom-membership-is-read))
(setq lyskom-membership (append lyskom-membership (list (car list)))))
(setq list (cdr list)))
(setq list (lyskom-array-to-list membership))
(while (and (not sent) list)
(if (and lyskom-unread-confs
(not (memq (membership->conf-no (car list))
......@@ -333,7 +338,17 @@ Information required for this:
(car list)
(cdr list))
(setq sent t))
(setq list (cdr list)))))
(setq list (cdr list)))
(if sent
nil
(initiate-get-part-of-membership 'main 'lyskom-start-anew-login-3
lyskom-pers-no
lyskom-membership-is-read
lyskom-fetch-membership-length))
(let ((reverse (reverse lyskom-membership)))
(while reverse
(lyskom-prefetch-conf (membership->conf-no (car reverse)))
(setq reverse (cdr reverse))))))
(defun lyskom-decide-unread-conf (conf-stat membship rest-memblist)
......
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