[Lift] Re: Sermo, persistent comet chat example
Hello list, Since I am presenting this Sermo example to an audience I want to understand how to flow of it works in more detail. When a new Chat CometActor is created it does the following 1. calls LocalSetup that register it with the ChatServer. 2. ChatServer then sends back the messages that are already there 3. lowPriority in Chat is called and partialUpdates the page with the messages. ( is this really done when the Chat cometActor registeres the first time? I would think that render should bind the content initially?) 4. localSetup is done so PerformReRender is called that again calls render 5. render binds the conent Is this the correct flow? When is fixedRender called? regards Bjarte On Mon, Sep 14, 2009 at 11:46 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Thanks, I googled a little bit and found this sollution myself as well :) Will push it to github any minute now. mvh Bjarte On Mon, Sep 14, 2009 at 11:42 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 14, 2009 at 2:17 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello David, Thanks for your comments. So you mean that instead of using m.id.obj then I should fetch all users in a map and lookup in that instead? import mapper._ private var chats: List[Message] = Message.findAll(PreCache(Message.user)).reverse This will pre-cache the user object in each Message instance. mvh Bjarte On Mon, Sep 14, 2009 at 10:39 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 14, 2009 at 1:18 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello lifted, Today i created Sermo [1] as the title says a persistent comet based chat example. I copied code from demo.liftweb.net/chat and modified to support - user's firstname + lastname is the username in the chat - messages are persisted in the message table and loaded when the chat server starts up. - chat is added as a page that requires user login I plan to use this example as a demo in a upcomming talk about lift. The reason I wanted a example that is a little bit more complex then the 50 line comet example is to show some more of lifts features. Comments and suggestions are very welcome. I had the honor to show Lift off to Phillip Wadler last year. I did the chat example and he asked How would you persist the chats? The code I came up with was surprisingly similar to your code. The only suggestion that I would have is to PreCache the Message.user fields to get better start-up performance. [1] http://www.github.com/bjartek/Sermo -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Sermo, persistent comet chat example
On Mon, Sep 14, 2009 at 1:18 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello lifted, Today i created Sermo [1] as the title says a persistent comet based chat example. I copied code from demo.liftweb.net/chat and modified to support - user's firstname + lastname is the username in the chat - messages are persisted in the message table and loaded when the chat server starts up. - chat is added as a page that requires user login I plan to use this example as a demo in a upcomming talk about lift. The reason I wanted a example that is a little bit more complex then the 50 line comet example is to show some more of lifts features. Comments and suggestions are very welcome. I had the honor to show Lift off to Phillip Wadler last year. I did the chat example and he asked How would you persist the chats? The code I came up with was surprisingly similar to your code. The only suggestion that I would have is to PreCache the Message.user fields to get better start-up performance. [1] http://www.github.com/bjartek/Sermo -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Sermo, persistent comet chat example
Hello David, Thanks for your comments. So you mean that instead of using m.id.obj then I should fetch all users in a map and lookup in that instead? mvh Bjarte On Mon, Sep 14, 2009 at 10:39 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 14, 2009 at 1:18 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello lifted, Today i created Sermo [1] as the title says a persistent comet based chat example. I copied code from demo.liftweb.net/chat and modified to support - user's firstname + lastname is the username in the chat - messages are persisted in the message table and loaded when the chat server starts up. - chat is added as a page that requires user login I plan to use this example as a demo in a upcomming talk about lift. The reason I wanted a example that is a little bit more complex then the 50 line comet example is to show some more of lifts features. Comments and suggestions are very welcome. I had the honor to show Lift off to Phillip Wadler last year. I did the chat example and he asked How would you persist the chats? The code I came up with was surprisingly similar to your code. The only suggestion that I would have is to PreCache the Message.user fields to get better start-up performance. [1] http://www.github.com/bjartek/Sermo -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Sermo, persistent comet chat example
On Mon, Sep 14, 2009 at 2:17 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello David, Thanks for your comments. So you mean that instead of using m.id.obj then I should fetch all users in a map and lookup in that instead? import mapper._ private var chats: List[Message] = Message.findAll(PreCache(Message.user)).reverse This will pre-cache the user object in each Message instance. mvh Bjarte On Mon, Sep 14, 2009 at 10:39 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 14, 2009 at 1:18 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello lifted, Today i created Sermo [1] as the title says a persistent comet based chat example. I copied code from demo.liftweb.net/chat and modified to support - user's firstname + lastname is the username in the chat - messages are persisted in the message table and loaded when the chat server starts up. - chat is added as a page that requires user login I plan to use this example as a demo in a upcomming talk about lift. The reason I wanted a example that is a little bit more complex then the 50 line comet example is to show some more of lifts features. Comments and suggestions are very welcome. I had the honor to show Lift off to Phillip Wadler last year. I did the chat example and he asked How would you persist the chats? The code I came up with was surprisingly similar to your code. The only suggestion that I would have is to PreCache the Message.user fields to get better start-up performance. [1] http://www.github.com/bjartek/Sermo -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Sermo, persistent comet chat example
Thanks, I googled a little bit and found this sollution myself as well :) Will push it to github any minute now. mvh Bjarte On Mon, Sep 14, 2009 at 11:42 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 14, 2009 at 2:17 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello David, Thanks for your comments. So you mean that instead of using m.id.obj then I should fetch all users in a map and lookup in that instead? import mapper._ private var chats: List[Message] = Message.findAll(PreCache(Message.user)).reverse This will pre-cache the user object in each Message instance. mvh Bjarte On Mon, Sep 14, 2009 at 10:39 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 14, 2009 at 1:18 PM, Bjarte Stien Karlsen bjarte.stien.karl...@gmail.com wrote: Hello lifted, Today i created Sermo [1] as the title says a persistent comet based chat example. I copied code from demo.liftweb.net/chat and modified to support - user's firstname + lastname is the username in the chat - messages are persisted in the message table and loaded when the chat server starts up. - chat is added as a page that requires user login I plan to use this example as a demo in a upcomming talk about lift. The reason I wanted a example that is a little bit more complex then the 50 line comet example is to show some more of lifts features. Comments and suggestions are very welcome. I had the honor to show Lift off to Phillip Wadler last year. I did the chat example and he asked How would you persist the chats? The code I came up with was surprisingly similar to your code. The only suggestion that I would have is to PreCache the Message.user fields to get better start-up performance. [1] http://www.github.com/bjartek/Sermo -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---