[Bese-devel] Re: expiring frames & ajax

Marco Baringer mb at bese.it
Thu Apr 20 11:16:51 UTC 2006


Evrim ULU <evrim at core.gen.tr> writes:

> Dear Marco,
>
> I've been playing around with my previous ajax implementation and it
> seems, my frames are expiring due to lru-queue. Do you have any
> suggestions about this? I couldn't made up a solution other than using a
> normal queue which will i suppose, increase memory consumption per
> single client. Any memory statistics about this would be appriciated.

i don't believe it's neccessary for ajax frames to create a new
frame. here's some code which runs an action within the same frame as
the one that created it (just like action-dispatcher' dispatch method
except for a one line change).

(defmethod dispatch ((dispatcher ajax-dispatcher)
                     (application standard-application)
                     (context standard-request-context))
  (when-bind session (find-session application context)
    (setf (context.session context) session
          (session.last-access session) (get-universal-time))
    (ucw.rerl.dispatcher.dribble "Found session ~S." session)
    (when-bind frame-id (find-frame-id context)
      (ucw.rerl.dispatcher.dribble "Found frame-id ~S." frame-id)
      (when-bind frame (find-frame-by-id session frame-id)
        (ucw.rerl.dispatcher.dribble "Found frame ~S." frame)
        (when-bind action (find-action frame (find-action-id context))
          (ucw.rerl.dispatcher.dribble "ACTION-DISPATCHER matched, calling action ~S." action)
          (setf (session.current-frame session) frame)
          (reinstate-backtracked frame)
          (call-callbacks frame (context.request context))
;;          (make-new-frame (context.session context))
          (with-action-error-handler () 
            (funcall action))
          (render-loop (frame.window-component (context.current-frame *context*)))
          (save-backtracked (context.current-frame *context*))
          t)))))

just uncomment the call to make-new-frame and ajax requests won't
affect the queue. the real question, and i'd love your feedback on
this, is how to tell if an action is an ajax action or not. hawe you
seen the ajax code which has been floating around? (sorry, i can't
remeber atm who wrote it).

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen




More information about the bese-devel mailing list