Hi there, I''m looking for a little guidance for a project I''d like to start. I''m fairly familiar with Rails, but still new to Ajax. I want a part of an app to include a back-and-forth between two people, kind of like a turn-based strategy game. Is Ajax able to do something like that? Can it observe when one person has passed it over to the other, and activate the second person''s screen accordingly? Thanks! Dave -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 7/7/07, Dave A. <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi there, > > I''m looking for a little guidance for a project I''d like to start. I''m > fairly familiar with Rails, but still new to Ajax. I want a part of an > app to include a back-and-forth between two people, kind of like a > turn-based strategy game. Is Ajax able to do something like that? Can it > observe when one person has passed it over to the other, and activate > the second person''s screen accordingly?You need something on the server side to tie the two people together. Javascript can only communicate with the server it''s being served from. You can send ajax requests every few seconds to the server to pick up new events that have happened. Can lead to a very busy server though:) Also, if you have a lot of ajax calls I suggest just using prototype directly and not use the rails helpers. It can improve performance quite a bit. Chris --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dave A. wrote:> I''m looking for a little guidance for a project I''d like to start. I''m > fairly familiar with Rails, but still new to Ajax. I want a part of an > app to include a back-and-forth between two people, kind of like a > turn-based strategy game. Is Ajax able to do something like that? Can it > observe when one person has passed it over to the other, and activate > the second person''s screen accordingly?Google for my street name, "how to chat", Rails, and Ajax. The best raw Ajax can do is a periodically_call_remote with a timer set to above a second. If you try to go faster than that, the internets'' pipes will start thrashing. If you need split-second resolution, then you need a system that leaves an internet connection open. That would be Juggernaut; it uses a small Flash dot on your screen to call-back to the server and leave this connection open. You can get sub-second resolution like this, and both browsers generally see the update at the exact same time. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Google for my street name, "how to chat", Rails, and Ajax. > > The best raw Ajax can do is a periodically_call_remote with a timer set > to > above a second. If you try to go faster than that, the internets'' pipes > will > start thrashing. > > If you need split-second resolution, then you need a system that leaves > an > internet connection open. That would be Juggernaut; it uses a small > Flash > dot on your screen to call-back to the server and leave this connection > open. You can get sub-second resolution like this, and both browsers > generally see the update at the exact same time.Thanks for your answers. I don''t think I''ll need an instantaneous system, a second or two lag is just fine. I am concerned about the server load, though. I''ll look into Juggernaut -- seems promising and I''m not adverse to a spec of flash. Thanks again! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---