I was wondering, imagine this situation. You have browser 1 on machine 1 and browser 2 on machine 2. I created a div so that I can update certain elements on the database. Is it possible to have the data rendered on browser 2 using ajax but without using the periodically call remote? Is it possible to use the submit event from browser 1 to trigger browser 2 to update? thanks, Bing -- Posted via http://www.ruby-forum.com/.
anyone pls? Guest wrote:> I was wondering, imagine this situation. You have browser 1 on machine 1 > and browser 2 on machine 2. I created a div so that I can update certain > elements on the database. Is it possible to have the data rendered on > browser 2 using ajax but without using the periodically call remote? Is > it possible to use the submit event from browser 1 to trigger browser 2 > to update? > > thanks, > > Bing-- Posted via http://www.ruby-forum.com/.
On Thu Jun 22, 2006 at 04:28:34AM +0200, Bing Tan wrote:> anyone pls?your main option is probably javascript''s settimeout(), selecting things in the db newer than a server-generated timestamp stored in the client and rjs to update any newer elements that may have arrived.. if you plan on doing a lot of this, you might want to check out a framework like twisted - its written in python, and is expressly designed for these kind of realtime messaging situations, and also works with many other protocols besides http..> > Guest wrote: > > I was wondering, imagine this situation. You have browser 1 on machine 1 > > and browser 2 on machine 2. I created a div so that I can update certain > > elements on the database. Is it possible to have the data rendered on > > browser 2 using ajax but without using the periodically call remote? Is > > it possible to use the submit event from browser 1 to trigger browser 2 > > to update? > > > > thanks, > > > > Bing > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
carmen wrote:> On Thu Jun 22, 2006 at 04:28:34AM +0200, Bing Tan wrote: >> anyone pls? > > your main option is probably javascript''s settimeout(), selecting things > in the db newer than a server-generated timestamp stored in the client > and rjs to update any newer elements that may have arrived.. if you plan > on doing a lot of this, you might want to check out a framework like > twisted - its written in python, and is expressly designed for these > kind of realtime messaging situations, and also works with many other > protocols besides http..Wow, I was pretty overwhelmed after checking twisted. Well, I don''t have any knowledge with python for one. Have you tried using twisted to work with ruby? I checked out thr RAA and found several event frameworks but again, still overwhelmed with which project maybe possible for what I need- as I searched for projects with the keyword "events" -- Posted via http://www.ruby-forum.com/.
Ezra Zygmuntowicz
2006-Jun-22 04:58 UTC
[Rails] Re: Re: Sans Periodically call remote-- possible?
On Jun 21, 2006, at 8:44 PM, Bing Tan wrote:> carmen wrote: >> On Thu Jun 22, 2006 at 04:28:34AM +0200, Bing Tan wrote: >>> anyone pls? >> >> your main option is probably javascript''s settimeout(), selecting >> things >> in the db newer than a server-generated timestamp stored in the >> client >> and rjs to update any newer elements that may have arrived.. if >> you plan >> on doing a lot of this, you might want to check out a framework like >> twisted - its written in python, and is expressly designed for these >> kind of realtime messaging situations, and also works with many other >> protocols besides http.. > > > Wow, I was pretty overwhelmed after checking twisted. Well, I don''t > have > any knowledge with python for one. Have you tried using twisted to > work > with ruby? I checked out thr RAA and found several event frameworks > but > again, still overwhelmed with which project maybe possible for what I > need- as I searched for projects with the keyword "events" > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsHave a look at EventMachine. Its on rubyforge.org. Its a very nice event driven framework for ruby. -Ezra
Bing Tan
2006-Jun-22 06:14 UTC
[Rails] Re: Re: Re: Sans Periodically call remote-- possible?
Ezra Zygmuntowicz wrote:> On Jun 21, 2006, at 8:44 PM, Bing Tan wrote: > >>> on doing a lot of this, you might want to check out a framework like >> but >> again, still overwhelmed with which project maybe possible for what I >> need- as I searched for projects with the keyword "events" >> >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > Have a look at EventMachine. Its on rubyforge.org. Its a very nice > event driven framework for ruby. > > -EzraHi Ezra, I was just about to check EventMachine out. But can you help me out, when you say it''s single-threaded what does it exactly mean? it means that each client browser can only make one thread with the server at a time? thanks, Bing -- Posted via http://www.ruby-forum.com/.
Bing Tan
2006-Jun-22 06:59 UTC
[Rails] Re: Re: Re: Sans Periodically call remote-- possible?
I had checked out Eventmachine and had a look at the forum. There was an inquiry there by a potential user with almost the exact same problem as mine and one of the responses indicated that, what I''m trying to do here is to evade the polling action of ajax which eventmachine isn''t build for. On another note though, do you think it is possible to put an observer field on a remote 2 browser that references against the actions from my browser? It''s interesting but I totally don''t have any idea how it is done. For example I was trying to check out gtalk inside gmail on my browser. whenever I am typing, the person I''m talking to sees that "user1 is typing..." does it mean that upon creation of the js window, an observer is created that is referenced again the person I am talking to? These things are taken for granted so often but it''s so painfully difficult to do! thanks, Bing -- Posted via http://www.ruby-forum.com/.
Ross Dawson
2006-Jun-22 07:14 UTC
[Rails] Re: Re: Re: Sans Periodically call remote-- possible?
> On another note though, do you think it is possible to put an > observer > field on a remote 2 browser that references against the > actions from my > browser? It''s interesting but I totally don''t have any idea how it is > done. For example I was trying to check out gtalk inside gmail on my > browser. whenever I am typing, the person I''m talking to sees that > "user1 is typing..." > > does it mean that upon creation of the js window, an observer > is created > that is referenced again the person I am talking to?Without looking too much into it I''d hazard a guess that this communicates through the web server. Browser 1 updated an input field Ajax sends it to the web server @ google gmail.com? Browser 2 polls the web server via Ajax to receive Browser 1''s text. Without installing additional software on the browser clients I don''t think it''s possible to do peer-peer chat. HTH Ross
Bing Tan
2006-Jun-22 09:19 UTC
[Rails] RE: Re: Re: Re: Sans Periodically call remote-- possible?
Ross Dawson wrote:>> is created >> that is referenced again the person I am talking to? > > Without looking too much into it I''d hazard a guess that this > communicates through the web server. > Browser 1 updated an input field > Ajax sends it to the web server @ google gmail.com? > Browser 2 polls the web server via Ajax to receive Browser 1''s text.Actually I think that''s how they''re doing definitely and the question is how are they doing it? How do you have Browser 2 (B2) pick the values up from Browser 1 (B1)? Note that it''s true B1 to B2 communication will be doable but imagine if you even just have 10 users. Since they are all served by the same controller, they will be fighting over the same resources and since B2''s polling mech is independent from the actions of B1''s message sending, eventualy with more users, you will see messages being rendered to other users will be missent and unrendered in some (bec the polling mech is all calling the same def and they are assigning their own unique values)> Without installing additional software on the browser clients I don''t > think it''s possible to do peer-peer chat.This is what the web chat on gtalk does. No installation needed and you can do peer to peer.> HTH > > RossThanks, Bing -- Posted via http://www.ruby-forum.com/.