Ralph Shnelvar wrote:
> Marnen Laibow-Koser wrote:
>> 
>> Probably.  Push is hard to impossible with Web technologies, unless you 
>> use Java or maybe Flash.  But you can certainly poll for updates with 
>> Ajax, which is no different on the server side than just hitting 
>> "reload" repeatedly in the browser.
> 
> I had this idea ... tell me what's wrong with it.
> 
> 
> 
> On the client side:
> 
> (1) Whenever the user changes her data we issue an Ajax request to 
> update the data the server knows about.

Fine.

> 
> (2) The client issues an asynchronous request (perhaps, an XHR) which 
> gets fulfilled when the server detects that there has been a change in 
> some player's data.

Impossible. That means the server will block till it has new data, which 
means the client will be stuck, waiting for a response from the server.

Or do you mean that the client simply polls periodically, and if the 
server has no new data, it just says so?

> 
> On the server side:
> 
> (3) The server waits for an Ajax request indicates that the client has 
> changed some data.

Sure.

> 
> (4) The server then satisfies the request(s) made in (2).
> 
> 

...blocking the client until it does so.

> 
> I have no idea how to have the server sit on an unfulfilled Ajax (or any 
> other) request.

Good.  You don't want to.

What you may be looking for is Comet (essentially Ajax over a persistent 
HTTP connection), but that's really hard to do AFAIK.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to