|
Posted by Ivαn Sαnchez Ortega on 10/18/05 11:01
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mike Willbanks wrote:
>> I have a script that makes multiple requests to several sites.[...]
>> How do I get it to send some data at a time?
[...]
> 1) Create an image that tells them [...]
> 2) The AJAX way[...]
> 3) The harder way (requires some research)
4) The threaded way
Use pcntl_fork() to create a child process (or, if posible, a thread) for
each site request. As all the children share the same stdout file
descriptor, you should be able to echo() text to the browser asyncronously
(or, you could use popen() or some other pipe mechanism to centrlize the
output).
However, this approach has the disadvantage of potentially becoming a
concurrency hell. Make sure you have the proper inter-locking mechanisms to
access the shared resources (in this case, stdout).
- --
- ----------------------------------
IvΓ‘n SΓ‘nchez Ortega -i-punto-sanchez--arroba-mirame-punto-net
Un ordenador no es un televisor ni un microondas, es una herramienta
compleja.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDVKvN3jcQ2mg3Pc8RAsloAJ0Rpdq0Z9erPIYXC1W/1dDxrg6ioACfed+x
qXepWc2RlJu2XXfO1Gx16Dw=
=Ts+N
-----END PGP SIGNATURE-----
Navigation:
[Reply to this message]
|