nutkenz wrote:
...you should know I first typed the word ECHO about a month ago so I really don't know what you just said.
LOL! OK. I didn't now that but I'd have to say you're not doing that bad if you need to have this conversation in such a
short period of time.
nutkenz wrote:
Well, this works when it's not busy with the function, I can keep it alive as long as I want then, but whenever it starts the function, the loop waits for that to complete... Which is only logical I suppose but I'd like to keep looping so the browser doesn't die before the WHOIS result has been found.
Yeah, you are right that it is logical. Essentially, this is an issue between blocking and non-blocking (normally in reference to I/O). Most of the
things we are going to call natively in PHP will block, or in other words, stop any other execution until they've finished. This is one of the nice
things about threads and each spun thread can run without negative effect on the process that spawned it.
So....
nutkenz wrote:Because I really really don't know how... Educate me

Forking is when a process (your running script or program) essentially creates (clones) what is a child process. Almost like mitosis (LOL). It will then ascertain that it is a child and execute the appropriate logic based on it's status. The idea in this case was that once the child was generating some useful (whois) information, it could write that information to a segment of shared memory. The parent process could try to read this shared memory in the loop with a tad delay between each try. If their is no information there, it continues to loop instead of waiting for the function to continue.
HOWEVER, using fork() may not be an option when running with Apache. All the time I ever used it was in CLI stuff.
Another option is to create a cli (command line) script that can be called by what what you have running. If you add an "&" at the end,
it should detach and run on it's own without holding up the works. It too could write to shared memory when it's finished and your web script could exit it's loop when it sees that your cli script is finished.
Lastly, the Asynchronus Javascript stuff that some otheres in thread should work fine, but I think there is a lot more mojo needed here to get it running.
Cheers,
BDKR