ASP.NET Chat ability - can I do this in Rails?



In this example they use: static protected ArrayList pArray = new
The neat trick is this chat doesn't have to rely on a database or
something like memcached, or text files to preserve the chat and quickly
hand it out to new people joining the chat. Its persisted in-memory
from within IIS or the ASP.NEt worker process from what I gather, kinda
like an Application variable almost.

and once your IIS thinks it needs to reload that class, your messages
are all gone. Besides that, I wouldn't call that ugly, noisy syntax
'neat' :wink:

Now since RoR is deployed on Lighttpd, Apache, Litespeed, or whatever
there doesn't seem to be anything like this. ie: there is no
"application state". Sure I could use a database but I really don't
want to hit the DB each time I get an AJAX call to get the latest chat
messages, or have to house clean them so only the 100 newest items
stayed in the table. Yes I could use memcached, but thats extra
overhead on my server I'd rather not incur if at all possible. Other
ideas I've seen is people witting to a text file - again - not ideal and
not scalable.

How do you define 'scalable'? Afaik storing the messages in a class
variable won't work in a distributed setup (with multiple .net servers),

Is there anyway to mimic what ASP.NET can do in RoR?

I'd go with a Drb server or with memcached. Imho the overhead of running
backgroundrb or memcached is quite small compared to that of having to
run and maintain a windows server + IIS.