Simplest technique for creating Chat Rooms

I’m creating a chat room in rails.

I was wondering what people think is the simplest technique to achieve
it?
What success/experience have other people had? Any optimisation
techniques would be useful to know.

Thanks
Chris

Chris wrote:

I’m creating a chat room in rails.

I was wondering what people think is the simplest technique to achieve
it?
What success/experience have other people had? Any optimisation
techniques would be useful to know.

Are you talking about a real-time chat room like Campfire? I think that
basically works by using some Javascript to poll the server every few
seconds to see if there are any new messages. I also vaguely remember
something about them writing a special lightweight handler on the
server side to respond to these messages without too much Rails
overhead.

Chris

I could imagine you could save overhead by sharing sessions between
different users.

You could store the chatroom in the shared session, with the last time
it was updated, and if it was updated within the last few seconds then
don’t update it, just use it, otherwise update the chatroom and place it
back in the shared session. How does that sound

If you’re looking for a non-polling solution, maybe investigate these:

http://lingr.com/
http://juggernaut.rubyforge.org/

Also there are plenty of established Java/applet solutions that can
be integrated - they might be a more surefire solution at this stage.

Chris wrote:

I’m creating a chat room in rails.

I was wondering what people think is the simplest technique to achieve
it?
What success/experience have other people had? Any optimisation
techniques would be useful to know.

Thanks
Chris

Have you looked at Peter C.'s chat app “Congress”. Maybe it will
give some ideas. Here is the link to its source.

http://www.petercooper.co.uk/media/congress1a.tar.gz