incubator-esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Pollak <feeder.of.the.be...@gmail.com>
Subject Re: Incremental updates?
Date Tue, 01 Dec 2009 00:24:22 GMT
On Sat, Nov 28, 2009 at 12:12 AM, Markus Kohler <markus.kohler@gmail.com>wrote:

> Hi all,
> As far as I can see by looking into the HTTP responses with Firebug, ESME
> always sends the whole list of messages back to the browser. Uncompressed
> this was in my case about 43 Kbyte( haven't checked how much it is
> compressed), which is significant for a single message update.
>
> I wonder whether there would be a way in Lift to incrementally update the
> page e.g. sending only the new messages, insert them into the DOM and maybe
> delete the last messages from the DOM to avoid an unlimited increase of the
> browsers memory usage.
>


Sure.  Lift's comet actor can send a pile of JavaScript as a
partialUpdate.   As long as you can figure out what JavaScript to execute on
the browser to incrementally update the data in the browser and then trigger
a partial redraw, Lift supports this.


>
> Where could I look in the code to understand, how it is currently done?
>

PublicTimeline.scala
Timeline.scala

Note the reRender calls.  These cause the whole shooting match to be sent.

You can see an example of partialUpdate in
http://github.com/dpp/liftweb/blob/master/lift-examples/example/src/main/scala/net/liftweb/example/comet/Chat.scala


>
> Regards,
> Markus
>
>
> "The best way to predict the future is to invent it" -- Alan Kay
>



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message