Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Oct 21, 2018 3:42 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: XMLHTTPRequest supported in W.E.?
PostPosted: Tue Sep 07, 2010 1:38 am 
Offline

Joined: Tue Oct 06, 2009 2:38 am
Posts: 435
I searched the forum archives and this turned up:

viewtopic.php?f=2&t=33581&p=186779

It seems that tvalleau's task would've been much easier if there was an XHR class/object. Does it exist in W.E.?


Top
 Profile  
Reply with quote  
 Post subject: Re: XMLHTTPRequest supported in W.E.?
PostPosted: Tue Sep 07, 2010 1:56 am 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
I read over the other thread and I'm not sure I understand the request. Do you want to be able to handle HTTP requests yourself? I don't see that likely to happen, as it could easily interfere with the built-in HTTP handling code.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: XMLHTTPRequest supported in W.E.?
PostPosted: Tue Sep 07, 2010 2:40 am 
Offline

Joined: Tue Oct 06, 2009 2:38 am
Posts: 435
I think he was trying to get the iPhone to control iTunes or something to that effect, but that's slightly tangential... I'm trying to understand the W.E. app architecture and how it communicates with the browser. Is the following correct?

Compiled W.E. binary app pushes HTML/CSS/JS through Apache/IIS/nginx/whatever web server that supports FastCGI or its own builtin webserver. Browser acts on the app based on DOM Level 2 (so we can add/remove our own JS event handlers) and sends data back to the app via AJAX.

What happens if I need a persistent connection to the browser? Is the data being streamed, function registered as a callback, polled etc? What level of customization do we have here? For example, a "realtime" stock ticker would require a persistent connection, setting a timer to "refresh the page" would not be the right way to do it. Would it be possible to "push" only the desired changes, kind of like how Twitter notifies the user of new tweets by using XHR?


Top
 Profile  
Reply with quote  
 Post subject: Re: XMLHTTPRequest supported in W.E.?
PostPosted: Tue Sep 07, 2010 10:05 am 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Ah, you're looking for push support. No, we don't have that yet. The server can never contact the client, only client to server - that's an HTTP thing. That's how RSW is designed. XHR does not provide push support.

However, XHR can be used with a technique called "long polling AJAX" which basically opens a connection to the server, and the server stalls the connection until there is something to reply with. Once a reply is received, the client opens a new connection and the process starts over again.

Personally, this feels like a real evil hack, but I can see the value in it. In the future, we intend to rework the architecture to allow push communication, but you won't see it in the initial release.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: XMLHTTPRequest supported in W.E.?
PostPosted: Tue Sep 07, 2010 7:25 pm 
Offline

Joined: Tue Oct 06, 2009 2:38 am
Posts: 435
Thom, thanks for the detailed reply. I sincerely appreciate it. This Wiki page has a brief survey of the techniques we discussed.

http://en.wikipedia.org/wiki/Comet_(programming)

Based on your response, I would presume that the recommendation (maybe incorrectly?) that W.E. app developers should be implementing the "script tag long polling" pattern (when it becomes available)? Also, if you refer to the "alternatives" section, are any of these being considered for use in the app server?

It would be nice to have a alternative to polling since tearing down and starting up new connections multiple times would likely be an expensive performance hit.


Top
 Profile  
Reply with quote  
 Post subject: Re: XMLHTTPRequest supported in W.E.?
PostPosted: Tue Sep 07, 2010 7:38 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Web developers need not think about it. The developer should be completely abstracted from the "how" we do it.

We're exploring more options than just long polling.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group