I have only started to learn using libcurl so my understanding is limited, but I think the general idea goes like this:
for a time consuming operation like HTTP where the slowness is largely external to the application (i.e. network, server response), it could be better to have a single thread performing multiple requests in a round robin manner, where it will alternate between waiting (no point in stressing the system) and calling select() with a decent timeout for each request. ideally, you could get near completing 3 requests that each take 3 seconds to complete in 3 seconds, not 9 seconds. so it is not enough to just be non-blocking, or yielding to other threads. the caller must also be nicer to other threads by alternating between idle and busy while it waits for data, especially when the server takes time to respond. it might be interesting to call HTTP Request in a preemptive worker, but whether the call relieves the application from stress may depend on other factors as well. > 2017/12/15 8:07、Cannon Smith via 4D_Tech <[email protected]> のメール: > I’m using 4D Server with the web server on. I want to have a stored procedure > on it occasionally use HTTP Get or HTTP Request to fetch some information > from a web service. The amount of data sent and received is very small (less > than 1 KB), but the web service usually takes 2-3 seconds to respond. There > may be days when I need to do this several thousands of times so I will > probably want to split the requests into multiple processes. > > My question is whether the HTTP Get/HTTP Request commands are non-blocking. I > notice the documentation says these two commands are preemptive ready, so I’d > like to assume they won’t block other processes, but is that only true if > they are run in a pre-emptive process? I’ve also heard that these kinds of > commands can really slow down the rest of the server. Or maybe this only > applies to the Internet Commands plugin calls? > > I guess I’m looking for experience/insight into this before I get too far > down the road. ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

