Re: Asynchronous HTTP

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu