Re: [WebDNA] HTTP Streaming -- impossible?
This WebDNA talk-list message is from 2010
It keeps the original formatting.
numero = 105549
interpreted = N
texte = Ken,Have you considered using Ajax and an iFrame? You could setup a javascript timer in your container page that reloads the iFrame with a call to a .dna page?MarcOn 7/11/2010 10:29 PM, Stuart Tremain wrote:> You could put the result (or what you are waiting for) in a small iframe then when the result is available it will refresh the whole page.>>> Regards>> Stuart Tremain> IDFK Web Developments> AUSTRALIA> webdna@idfk.com.au>>>>> On 12/07/2010, at 8:58 AM, Kenneth Grome wrote:>>> Has anyone actually done HTTP streaming in webdna?>>>> My understanding of the basic concept is that the server receives a request from the browser, then it keeps the connection open via a long running (or infinite) loop of some kind, and then it periodically pushes new data to the outgoing stream and flushes the stream -- without closing the connection.>>>> I can create a loop in webdna with no problem, but how do I flush the periodic data to the stream without the server closing the connection? I have tried this as a test:>>>> [loop start=1&end=10]>> [waitforfile file=doesNotExist.txt&timeout=2][/waitforfile]>> [writefile textFile.txt][time][/writefile]>> [include textFile.txt]
>> [/loop]>>>> ... but of course this does not work because the page is not rendered until after the loop stops running. I get these results all at once, but what I actually want is one line at a time pushed to the stream/browser every 2 seconds:>>>> 17:39:36>> 17:39:37>> 17:39:39>> 17:39:40>> 17:39:41>> 17:39:42>> 17:39:43>> 17:39:45>> 17:39:46>> 17:39:47>>>> I know a lot about webdna, but at the moment I cannot think of a way to make this work. Can any of you?>>>> The problem is that webdna does not produce any results or render the page until ALL the code on the page has been interpreted. Only then will it send the results to the server -- which then forwards those results on to the browser and closes the connection.>>>> Anyone see any webdna-based alternatives here?>>>> Sincerely,>> Kenneth Grome>>>> P.S. As an aside, my test seems to indicate that the timer in "waitforfile" is not very accurate. The total time for all 10 lines to be processed should have been 20 seconds, not 11. Let that be a lesson to anyone who wants to rely on the accuracy of the waitforfile timer!>>>> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list
.>> To unsubscribe, E-mail to:>> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list.> To unsubscribe, E-mail to:> archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us> .>-- -------------------------------------------Marc ThompsonSoftware EngineerMedia SolutionsUniversity Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Associated Messages, from the most recent to the oldest:
Ken,Have you considered using Ajax and an iFrame? You could setup a javascript timer in your container page that reloads the iFrame with a call to a .dna page?MarcOn 7/11/2010 10:29 PM, Stuart Tremain wrote:> You could put the result (or what you are waiting for) in a small iframe then when the result is available it will refresh the whole page.>>> Regards>> Stuart Tremain> IDFK Web Developments> AUSTRALIA> webdna@idfk.com.au>>>>> On 12/07/2010, at 8:58 AM, Kenneth Grome wrote:>>> Has anyone actually done HTTP streaming in webdna?>>>> My understanding of the basic concept is that the server receives a request from the browser, then it keeps the connection open via a long running (or infinite) loop of some kind, and then it periodically pushes new data to the outgoing stream and flushes the stream -- without closing the connection.>>>> I can create a loop in webdna with no problem, but how do I flush the periodic data to the stream without the server closing the connection? I have tried this as a test:>>>> [loop start=1&end=10]>> [waitforfile file=doesNotExist.txt&timeout=2][/waitforfile]>> [writefile textFile.txt][time][/writefile]>> [include textFile.txt]
>> [/loop]>>>> ... but of course this does not work because the page is not rendered until after the loop stops running. I get these results all at once, but what I actually want is one line at a time pushed to the stream/browser every 2 seconds:>>>> 17:39:36>> 17:39:37>> 17:39:39>> 17:39:40>> 17:39:41>> 17:39:42>> 17:39:43>> 17:39:45>> 17:39:46>> 17:39:47>>>> I know a lot about webdna, but at the moment I cannot think of a way to make this work. Can any of you?>>>> The problem is that webdna does not produce any results or render the page until ALL the code on the page has been interpreted. Only then will it send the results to the server -- which then forwards those results on to the browser and closes the connection.>>>> Anyone see any webdna-based alternatives here?>>>> Sincerely,>> Kenneth Grome>>>> P.S. As an aside, my test seems to indicate that the timer in "waitforfile" is not very accurate. The total time for all 10 lines to be processed should have been 20 seconds, not 11. Let that be a lesson to anyone who wants to rely on the accuracy of the waitforfile timer!>>>> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list.>> To unsubscribe, E-mail to:>> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list.> To unsubscribe, E-mail to:> archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us> .>-- -------------------------------------------Marc ThompsonSoftware EngineerMedia SolutionsUniversity Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Marc Thompson
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
WebCatalog2 Feature Feedback (1996)
Polls (2003)
transferring values (1998)
autosensing lanague selection (1997)
French characters in variables (2001)
Shopping cart not being assigned (1999)
shipcost (1997)
Checking for WebCatalog Version (2000)
[include file=filename.inc&strip=t] (2002)
Performance Settings (2000)
Test (2000)
multi-paragraph fields (1997)
Extended [ConvertChars] (1997)
flushdatabases (2000)
Document Contains No Data! (1997)
WebCatalog 2.0 & WebDNA docs in HTML ... (1997)
Setting up WebCatalog with Retail Pro data (1996)
WebDNA on Linux (2005)
NetSplat and WebCat2 (1997)
Locking up with WebCatalog... (1997)