My fundamental lack understanding of Rails and the architecture of the
'Net wil be demonstrated by the following question:
The following is a contrived example:
Assume I have several users looking at (identical) screens. Say, there
is some slowly changing stock market data that they are all looking at.
The price of the stock changes, say, once every minute.
Assume that a Rails application detects a change to the price and wants
to push the change out to the users without the users needing to do
anything? How does one make that happen?
My fundamental lack understanding of Rails and the architecture of the
'Net wil be demonstrated by the following question:
The following is a contrived example:
Assume I have several users looking at (identical) screens. Say, there
is some slowly changing stock market data that they are all looking at.
The price of the stock changes, say, once every minute.
Assume that a Rails application detects a change to the price and wants
to push the change out to the users without the users needing to do
anything? How does one make that happen?
One doesn't, at least not without using Flash, Java, or Comet. Web
technologies don't do push.
The best you can do is to have the client poll the server every so
often.
One doesn't, at least not without using Flash, Java, or Comet. Web
technologies don't do push.
The best you can do is to have the client poll the server every so
often.
Can this polling be done with jQuery?
Yes.
Can one point to an example?
Do you really need an example? It's just a matter of periodically
making Ajax requests (or refreshing a page, which is the same thing on
the server side).
Do you really need an example? It's just a matter of periodically
making Ajax requests (or refreshing a page, which is the same thing on
the server side).
Yes, a nice small Ajax query being made from javaScript or jQuery would
be very nice.