From: Jeffrey Moss Date: 2005-06-23T02:48:27+09:00 Subject: Re: writing a web chat room--sharing info? I was thinking about how to do a chat room like this. The conclusion I reached was that if I had the page "refreshing" every second to display new messages, it would create a high load on the server, each of my rails requests typically takes an entire second to process, so my solution was to write the chat conversation to an html file in a folder in the web root where mod_rewrite was disabled and that way the web server could serve the file with haste and free the web server from unnecessary processing. -Jeff ----- Original Message ----- From: "Matt C" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Wednesday, June 22, 2005 11:40 AM Subject: Q: writing a web chat room--sharing info? > New to Ruby, and haven't tried anything like this before. > > I'd like to write a web page that acts like a "chat room". (Actually, > I'd like to write a game that incorporates the chat room idea, but first > things first.) Nothing unusual here: a big window that shows what other > people have typed, and a small textbox below where you can type your own > messages. This can be done with ajax, there are some examples on the web > (but not Ruby ones, that I found anyway). > > I'm not sure what the best way to share info between the different web > users is. There are several possibilities I can think of: use a text > file, use a database, write a daemon, use memcache. > > I'm leaning toward using a database at this point because 1) there won't > be issues finding hosting if I use a db, and 2) I have experience with > databases, unlike daemons and memcache. Still, it seems like overkill to > go in and out of a database when all I really want is shared access to an > array. > > Does anybody have a better idea, or other suggestions? > > Also, a completely unrelated question for those who read this far. I > notice there seem to be two competing Ruby conventions for naming > methods. My copy of the Pickaxe book (first edition) uses > mixedCaseNaming. Other sources (Ruby itself, frex) use > underscore_naming. Is one of these prevalent, or is it whichever you > like better? > > Thanks for any advice, > > Matt >