You are here: Re: How to send data a little at a time? « PHP Programming Language « IT news, forums, messages
Re: How to send data a little at a time?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация