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? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ralph Shnelvar wrote:> 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. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 7, 3:35 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Ralph Shnelvar wrote: > > 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. >or Web Sockets soon (trunk builds of Firefox & Google chrome support this I believe) Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You could have a page with some javascript that polls your main server every X seconds and redraw the page as required. However with a lot of users and a small value of X your server is going to complain. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote:> 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? Can one point to an example? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ralph Shnelvar wrote:> Marnen Laibow-Koser wrote: > >> 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). Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote:>> 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).Yes, a nice small Ajax query being made from javaScript or jQuery would be very nice. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.