1. Asynchronous HTTP
- Posted by Craig Welch <euphoria at welchaviation.org> May 06, 2005
- 408 views
I'm commencing an application that will go get a multitude of web pages. There's been a number of EU applications for HTTP requests. I like the look of AsyncHTTP.ew. because I can get a number of requests under way at the same time. But that leads to a limitation of my understanding of how to process them. >From the documentation: "Because it is asynchronous you do not simply call a function which returns a value, you call a procedure to say that you wish to retrieve a document and when it has been retrieved you are notified". That's straightforward, but if I send 10 requests, and they all come back at about the same time, I presume my handler is going to be interrupted up to 9 times. Do I somehow have to write re-entrant code for the handler? Are there any guidelines on how to do this? Or have I missed a point somewhere? Thanks, -- Craig
2. Re: Asynchronous HTTP
- Posted by codepilot Gmail Account <codepilot at gmail.com> May 06, 2005
- 389 views
Async HTTP is based off of AsyncSelect which just sends messages to a window, and they get processed by some functions for the http, and then they call you. Not re-entrant the same code that gets run for the mouse moving or the window resizing is the same kind of code for asynchttp that you need to write. Dan On 5/5/05, Craig Welch <euphoria at welchaviation.org> wrote: > > I'm commencing an application that will go get a multitude of web > pages. There's been a number of EU applications for HTTP requests. > > I like the look of AsyncHTTP.ew. because I can get a number of > requests under way at the same time. But that leads to a limitation of > my understanding of how to process them. > > >From the documentation: "Because it is asynchronous you do not simply > call a function which returns a value, you call a procedure to say > that you wish to retrieve a document and when it has been retrieved > you are notified". > > That's straightforward, but if I send 10 requests, and they all come > back at about the same time, I presume my handler is going to be > interrupted up to 9 times. Do I somehow have to write re-entrant code > for the handler? Are there any guidelines on how to do this? Or have I > missed a point somewhere? > > Thanks, > > -- > Craig > > > > >
3. Re: Asynchronous HTTP
- Posted by "Kat" <gertie at visionsix.com> May 07, 2005
- 401 views
On 6 May 2005, at 14:55, Craig Welch wrote: > > > I'm commencing an application that will go get a multitude of web > pages. There's been a number of EU applications for HTTP requests. > > I like the look of AsyncHTTP.ew. because I can get a number of > requests under way at the same time. But that leads to a limitation of > my understanding of how to process them. > > >From the documentation: "Because it is asynchronous you do not simply > call a function which returns a value, you call a procedure to say > that you wish to retrieve a document and when it has been retrieved > you are notified". > > That's straightforward, but if I send 10 requests, and they all come > back at about the same time, I presume my handler is going to be > interrupted up to 9 times. Do I somehow have to write re-entrant code > for the handler? Are there any guidelines on how to do this? Or have I > missed a point somewhere? I use this: function getw(sequence filename) sequence savefile savefile = current_dir() & "\\wget2\\tmp.txt" junk = system_exec(current_dir() & "\\wget2\\wget.exe -T60 -A txt,html,htm -qO "&savefile&" "&filename,2) junk = getf(savefile) return junk end function -- getw() Modify it to not block, but to return immediately, tell it to save to different files, poll them to see when they are done. Eu needs these things people ask for. Kat